-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature step5 integration #51
Conversation
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.
Modified in #45. Wait for merge?
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.
Modified in #45. Wait for merge?
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.
Yes!!
… an old version. I updated it
Co-authored-by: Carlos Paniagua <[email protected]>
Fix step2
list installed depedencies
…-code fix: use slidegeneric access in sliderule
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.
A couple more cleanups suggested!
Co-authored-by: Carlos Paniagua <[email protected]>
…2-tracks into feat-step5-intg
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.
Happy to see this passing!
I have some general comments and questions, two suggestions for issues I've seen elsewhere in the package, and a couple suggested changes.
angle_optimizer.patch
Outdated
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.
What is this file for? Its extension is kind of confusing.
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.
My idea was to patch the angle_optimizer
which is the one making step5 crash. This patch file has the instruction that changes the specific line that causes the error. But it seems patching the file didnt work either. I'm removing it, but leaving a comment in the angle_optimizer.py
file mentioning how we solved this issue.
# TODO: this funciton throws an error in CI. The nan_policy='omit' policiy was added to avoid this issue | ||
# according to the guidelines in https://lmfit.github.io/lmfit-py/faq.html#i-get-errors-from-nan-in-my-fit-what-can-i-do | ||
self.fitter = self.LM.minimize(self.objective_func, self.params, method=method, | ||
args=fitting_args, kws=fitting_kargs , | ||
nwalkers=self.nwalkers, steps=steps, pos= self.seeds, **kargs) | ||
nwalkers=self.nwalkers, steps=steps, pos= self.seeds,nan_policy='omit' , **kargs) |
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.
Is there something still left to do here? Otherwise, the 'TODO'
part of the comment could be removed if the change is going to be kept.
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.
This line is the one throwing the error. The TODO comment is just to remind us that something needs to be done here
import icesat2_tracks.ICEsat2_SI_tools.spicke_remover as spicke_remover | ||
import datetime | ||
import icesat2_tracks.ICEsat2_SI_tools.generalized_FT as gFT | ||
from scipy.ndimage.measurements import label |
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 think this import throws a deprecation warning.
from scipy.ndimage.measurements import label | |
from scipy.ndimage import label |
Maybe an issue should be created as I've seen this elsewhere in the package.
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.
done!
@@ -114,10 +118,12 @@ def linear_gap_fill(F, key_lead, key_int): | |||
exit() | |||
|
|||
# test LS with an even grid where missing values are set to 0 | |||
imp.reload(spec) |
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.
Lines with imp.reload
and its corresponding import statements can be removed. imp
or its successor importlib
are modules people use during development, not for production code.
There are many instances where imp
is used in the package. Maybe for another issue?
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.
for k in all_beams: | ||
# print(k) # TODO: add logger | ||
hkey = "heights_c_weighted_mean" | ||
x = Gd[k + "/dist"][:] | ||
# print(x[0], x[-1]) # TODO: add logger | ||
print(k) | ||
hkey = "h_mean" |
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.
L160 should go outside (before) of the for loop here.
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.
Clarifying question for me: why the change "heights_c_weighted_mean"
=> "h_mean"
?
Another sliderule breaking change perhaps?
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.
@mochell any thoughts ? ☝️
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.
L160 should go outside (before) of the for loop here.
@kmilo9999 What do you think of this change?
If this change is made, the other line, L191, where hkey
is redefined with the same value can be deleted.
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.
The hkey
is being redefined in line 188 with the same value. I'm removing it from the loop
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 noted a change that was undone (docstring at the top) and I saw a constant being defined in a for loop.
for k in all_beams: | ||
# print(k) # TODO: add logger | ||
hkey = "heights_c_weighted_mean" | ||
x = Gd[k + "/dist"][:] | ||
# print(x[0], x[-1]) # TODO: add logger | ||
print(k) | ||
hkey = "h_mean" |
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.
L160 should go outside (before) of the for loop here.
@kmilo9999 What do you think of this change?
If this change is made, the other line, L191, where hkey
is redefined with the same value can be deleted.
Co-authored-by: Carlos Paniagua <[email protected]>
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.
🍻
analysis_db/B04_angle.py
ICEsat2_SI_tools/generalized_FT.py
andICEsat2_SI_tools/sliderule_converter_tools.py
to fix integration issues