Skip to content

Conversation

pluAtAnsys
Copy link
Collaborator

@pluAtAnsys pluAtAnsys commented Aug 5, 2025

Description

  • radiant flux
  • luminous flux
  • luminous_intensity
    need some testing and proper definition

Add properties to SourceLuminaire:

  • radiant flux
  • luminous flux
  • intensity file
  • axissystem

add properties to SourceRayfile:

  • rayfile_url
  • radiant flux
  • luminous flux
  • axissystem

add properties to SourceSurface

  • add properties to exitance class
    • XMP file URL
    • axissystem
  • radiant flux
  • luminous flux
  • luminous_intensity
  • Constant exitance class + Geometry property

Issue linked

Refactor source #684

Checklist

  • I have tested my changes locally.
  • I have added necessary documentation or updated existing documentation.
  • I have followed the coding style guidelines of this project.
  • I have added appropriate tests (unit, integration, system).
  • I have reviewed my changes before submitting this pull request.
  • I have linked the issue or issues that are solved by the PR if any.
  • I have assigned this PR to myself.
  • I have made sure that the title of my PR follows Conventional commits style (e.g. feat: add optical property)
  • I have agreed with the Contributor License Agreement (CLA).

@pluAtAnsys pluAtAnsys linked an issue Aug 5, 2025 that may be closed by this pull request
@pluAtAnsys pluAtAnsys self-assigned this Aug 5, 2025
@pluAtAnsys pluAtAnsys removed a link to an issue Aug 5, 2025
This was linked to issues Aug 5, 2025
@pluAtAnsys pluAtAnsys changed the title wip: refactor source class feat: refactor source class Aug 6, 2025
@pluAtAnsys pluAtAnsys removed a link to an issue Aug 6, 2025
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 93.16456% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.07%. Comparing base (129bdf0) to head (c14208f).

Files with missing lines Patch % Lines
src/ansys/speos/core/source.py 90.68% 19 Missing ⚠️
src/ansys/speos/core/spectrum.py 91.78% 6 Missing ⚠️
src/ansys/speos/core/sensor.py 97.43% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #690      +/-   ##
==========================================
+ Coverage   88.90%   89.07%   +0.16%     
==========================================
  Files          39       39              
  Lines        5617     5904     +287     
==========================================
+ Hits         4994     5259     +265     
- Misses        623      645      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pluAtAnsys pluAtAnsys marked this pull request as ready for review August 6, 2025 15:20
@pluAtAnsys pluAtAnsys requested a review from SMoraisAnsys August 6, 2025 15:23
@pluAtAnsys
Copy link
Collaborator Author

@SMoraisAnsys @echambla @StefanThoene Could you please review the refactor methods

@StefanThoene
Copy link
Collaborator

cheat sheet need to be adjusted

@@ -106,6 +110,129 @@ def __init__(
self.source_template_link = self._project.client[source_instance.source_guid]
self._reset()

class Luminous:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate A flux class.
has a property value and a set luminous and set radiant value

what do you think about that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default it is luminous if you use the set radiant value it take sthe current value and puts ist to radiant and dependdant on the state the value setter works.

i think user experience would be better

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a Flux class is an idea
I see also the property value that you mention.
Regarding the set luminous and set radiant, will they be properties or methods?
Also in this case it is important to think at the possibility from_intensity_file / from_ray_file

Where you thinking at something like that?
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another possibility that would avoid having to create a new Flux class:
image
With this, we could use the fact that the three properties are all starting with "flux_" to give the user an indication that he has to pick up one of these three properties to define the flux.

@@ -846,6 +1049,151 @@ class SourceSurface(BaseSource):
Uses default values when True.
"""

class Intensity:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include in flux class?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or add through inheritance

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor source Refactor SPectrum
4 participants