-
Notifications
You must be signed in to change notification settings - Fork 91
Rename shadow factor to illumination factor #1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| double shadowFactor; | ||
| } EclipseMsgPayload; | ||
|
|
||
| //! illuminationFactor alias to be used instead of shadowFactor. shadowFactor will be deprecarted by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated is miss-spelled.
| Eigen::Vector3d aHat_B; //!< [] (optional) unit direction vector of the sensor/communication boresight axis | ||
| double theta; //!< [r] (optional) sensor/communication half-cone angle, must be set if shat_B is specified | ||
| double theta_solar; //!< [r] (optional) illumination half-cone angle, treating aHat_B as the surface normal | ||
| double min_shadow_factor; //!< [] (optional) minimum amount of illumination due to eclipse necessary to observe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are changing a module variable which is a breaking change. Let's deprecate setting the old module variable name.
| \caption{Definition and Explanation of Variables Used.} | ||
| \centering \fontsize{10}{10}\selectfont | ||
| \begin{tabular}{ | m{5cm}| m{2cm} | m{1.5cm} | m{6cm} |} % Column formatting, | ||
| \begin{tabular}{ | m{5cm}| m{2cm} | m{1.5cm} | m{6cm} |} % Column formatting, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you update the TeX you also need to compile the TeX document and commit the updated PDF.
| # Forward direction: setting illuminationFactor updates shadowFactor | ||
| p.illuminationFactor = 0.8 | ||
| assert p.illuminationFactor == pytest.approx(0.8) | ||
| assert p.shadowFactor == pytest.approx(0.8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not following what this test is doing? line 420 is still throwing a depreciation warning. When running all BSK unit tests, I should not be seeing a depreciation warning. If I added deprecated.filterwarnings("ignore", "p.shadowFactor") I still saw the deprecation warning.
Description
The variable
shadowFactoris used to determine if a satellite is in the shadow of a planet, and if yes, by how much. A value of 1 meant the satellite was outside the shadow, and a value of 0 meant it was fully in the shadow. However, the name implies the opposite behavior. Thus, we are changing this variable name to reflect better describe what it does.This PR adopts a clearer name for the eclipse payload field:
illuminationFactor. For backward compatibility,shadowFactorcontinues to work and is formally deprecated until Dec 31, 2026.C / C++
EclipseMsgPayloadstill stores:double shadowFactor;illuminationFactoris introduced as a preprocessor alias toshadowFactorPython / SWIG
EclipseMsgPayload.illuminationFactoris exposed as a property that delegates to the same getter/setter asshadowFactor(no behavior or performance changes).EclipseMsgPayload.shadowFactorremains available but:Basilisk.utilities.deprecated.deprecationWarn) up to 2026-12-31.EclipseMsgRecorder(fromeclipseMsg.recorder()) now also supports:recorder.illuminationFactor→ alias forrecorder.shadowFactorso log access uses the new name without breaking existing code.
Modules / Files Touched
architecture/msgPayloadDefC/EclipseMsgPayload.hilluminationFactoralias and associated comments.architecture/messaging/msgAutoSource/msgInterfacePy.i.inilluminationFactorproperty onEclipseMsgPayload.shadowFactorwith deprecation behavior.EclipseMsgRecorderto handleilluminationFactorin logs.illuminationFactorwhile remaining compatible withshadowFactor.Verification
test_shadow_vs_illumination_alias_and_deprecation_behaviorvalidates:illuminationFactorandshadowFactorstay numerically in sync.shadowFactoremits a deprecation warning (checked withpytest.warns).shadowFactorto raise an error whileilluminationFactorcontinues to work.Documentation
illuminationFactoras the preferred name.shadowFactoras deprecated and scheduled for removal after Dec 31, 2026.Future work
Remove the C macro alias and the Python
shadowFactornaming