-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix some issues with SkyCalcTERCurve #245
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This table is used in | ||
# test_SkycalcTERCurve.py::TestRescalingAndUnitConversion::test_rescaling | ||
# It is essential that this table goes all the way to 2.500 for the | ||
# test to work properly. | ||
# | ||
wavelength transmission | ||
0.780 0.000100000 | ||
1.895 0.000100000 | ||
1.932 0.000403475 | ||
1.940 0.00122141 | ||
1.948 0.00273684 | ||
1.949 0.00377545 | ||
1.954 0.00896850 | ||
1.955 0.0100071 | ||
1.959 0.0282328 | ||
1.960 0.0349870 | ||
1.961 0.0417412 | ||
1.964 0.0735057 | ||
1.965 0.101068 | ||
1.967 0.187416 | ||
1.968 0.279336 | ||
1.969 0.402423 | ||
1.970 0.580067 | ||
1.971 0.833265 | ||
1.972 0.937967 | ||
2.327 0.940656 | ||
2.328 0.903457 | ||
2.329 0.756261 | ||
2.330 0.600915 | ||
2.331 0.422942 | ||
2.333 0.213269 | ||
2.334 0.145727 | ||
2.335 0.121079 | ||
2.336 0.0964298 | ||
2.343 0.0329677 | ||
2.349 0.0102813 | ||
2.350 0.00928342 | ||
2.351 0.00828549 | ||
2.380 0.000388406 | ||
2.402 0.000132468 | ||
2.435 0.000100000 | ||
2.500 0.000100000 |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1008,3 +1008,14 @@ def return_latest_github_actions_jobs_status(owner_name="AstarVienna", repo_name | |||||
params_list.append(params) | ||||||
|
||||||
return params_list | ||||||
|
||||||
|
||||||
def save_unit_to(unit_from: u.Unit, unit_to: u.Unit): | ||||||
"""Like unit_from.to(unit_to), but u.um to u.nm == 1000, not 999.999..""" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you state the purpose of the function more explicitely, please? "Like this or that" is a bit vague. Also, the docstring suggests to me that the function should be called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not very fond of that function |
||||||
to1 = unit_from.to(unit_to) | ||||||
sto1 = str(to1) | ||||||
to2 = 1 / unit_to.to(unit_from) | ||||||
sto2 = str(to2) | ||||||
if len(sto2) < len(sto1): | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Save two lines and two temp variables? It's not like they're used again, nor are the expressions long... |
||||||
return to2 | ||||||
return to1 |
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.
Does it still "lead to an error"? Isn't that what was fixed here? Same for the comment at the bottom of this method.