Skip to content

total_track operand #212

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

Merged
merged 2 commits into from
Jul 5, 2025
Merged

total_track operand #212

merged 2 commits into from
Jul 5, 2025

Conversation

drpaprika
Copy link
Collaborator

@drpaprika drpaprika commented Jul 5, 2025

Adds the total_track operand to ParaxialOperand.
It is called using:

input_data = {'optic': lens}
problem.add_operand(
    operand_type='total_track',
    target=100,  # [mm]
    weight=1,
    input_data=input_data,
)

It appears that currently the total track is computed in surface_group.py using z = self.positions[1:-1]. The last surface to image distance is not accounted for, is it intended ?
I assumed it was not and corrected it, as it makes sense to me to include the sensor distance in the computation.
Therefore some tests fail, I'll update them or revert the total track computation according to your inputs.

Best,
drpaprika

@HarrisonKramer
Copy link
Owner

Hi @drpaprika,

Thanks for opening this PR. You are right - the total track is not defined correctly. This was an oversight on my part. This can be updated to include the image surface, and tests can be updated. Happy to help here if needed.

Best,
Kramer

Copy link

codecov bot commented Jul 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #212   +/-   ##
=========================================
  Coverage          ?   95.51%           
=========================================
  Files             ?      162           
  Lines             ?     9016           
  Branches          ?        0           
=========================================
  Hits              ?     8612           
  Misses            ?      404           
  Partials          ?        0           
Files with missing lines Coverage Δ
optiland/optimization/operand/operand.py 98.30% <ø> (ø)
optiland/optimization/operand/paraxial.py 97.67% <100.00%> (ø)
optiland/surfaces/surface_group.py 94.81% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@drpaprika
Copy link
Collaborator Author

Thanks for your feedback I fixed the tests, it should be ready to merge

@HarrisonKramer HarrisonKramer merged commit a8e8a13 into master Jul 5, 2025
12 checks passed
@HarrisonKramer HarrisonKramer deleted the feat/total_track_operand branch July 6, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants