-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: sensor #691
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: main
Are you sure you want to change the base?
refactor: sensor #691
Conversation
fix minor issues on sensors classes
minor fix on radiance class
@pluAtAnsys can you have alook why the test_camera_modify_after_reset test is failing |
@SMoraisAnsys could you review the refactor? |
feat_ssrs[0].set_type_colorimetric().set_wavelengths_range().set_end(value=800) |
That is the project unit test... i didn'T even know yet that it is failing... i started with the sensor test |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
==========================================
- Coverage 88.99% 88.19% -0.81%
==========================================
Files 39 39
Lines 5653 6210 +557
==========================================
+ Hits 5031 5477 +446
- Misses 622 733 +111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# Conflicts: # tests/core/test_sensor.py
integration_type: Union[IntegrationTypes.planar, IntegrationTypes.radial] = ( | ||
IntegrationTypes.planar | ||
) |
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.
integration_type: Union[IntegrationTypes.planar, IntegrationTypes.radial] = ( | |
IntegrationTypes.planar | |
) | |
integration_type: IntegrationTypes = IntegrationTypes.planar |
See below to post_init check
layer_type: Union[LayerTypes.none, LayerTypes.by_source] = LayerTypes.none | ||
"""Layer separation type.""" | ||
geometries: list = None | ||
"""Sensor geometry.""" |
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.
"""Sensor geometry.""" | |
"""Sensor geometry.""" | |
def __post_init__(self): | |
"""Verify the dataclass initiation.""" | |
# Validation: restrict integration_type | |
if self.integration_type not in {IntegrationTypes.planar, IntegrationTypes.radial}: | |
raise ValueError( | |
f"Invalid integration_type '{self.integration_type }'. Must be planar, or radial." | |
) | |
if self.layer_type not in {None, layer_type.by_source}: | |
raise ValueError( | |
f"Invalid layer_type '{self.layer_type }'. Must be None, or by_source." | |
) |
IntegrationTypes.planar | ||
) | ||
"""Integration type.""" | ||
rayfile_type: Union[RayfileTypes] = RayfileTypes.none |
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.
rayfile_type: Union[RayfileTypes] = RayfileTypes.none | |
rayfile_type: Optional[RayfileTypes] = None |
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.
that will break the class
"""Integration type.""" | ||
rayfile_type: Union[RayfileTypes] = RayfileTypes.none | ||
"""Rayfile type stored.""" | ||
layer_type: Union[LayerTypes.none, LayerTypes.by_source] = LayerTypes.none |
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.
layer_type: Union[LayerTypes.none, LayerTypes.by_source] = LayerTypes.none | |
layer_type: Optional[LayerTypes] = None |
See below to post_init check
gamma_correction: float = 2.2 | ||
"""Gamma correction Value for the Camera Sensor.""" | ||
transmittance_file_uri: str = "" | ||
"""Transmittance spectrum location""" |
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.
"""Transmittance spectrum location""" | |
"""Transmittance spectrum location""" | |
def __post_init__(self): | |
"""Verify the dataclass initiation.""" | |
# Validation: restrict layer_typenot | |
if self.layer_typenot in {None, LayerTypes.by_source}: | |
raise ValueError( | |
f"Invalid layer_typenot '{self.layer_typenot }'. Must be None, or by_source." | |
) |
Co-authored-by: Pengyuan LU <89462462+pluAtAnsys@users.noreply.github.com>
for more information, see https://pre-commit.ci
Description
Implment property based approach
Issue linked
#685
Checklist
feat: add optical property
)