-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add data preparation functions for the Kr map computation #865
base: master
Are you sure you want to change the base?
Conversation
16d65f1
to
0741041
Compare
Some comments:
Tests:
|
0741041
to
b0f7f55
Compare
d287075
to
4578a4b
Compare
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.
First round. This is being done with peras, more or less.
9520347
to
a898d85
Compare
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 more in-depth review now. Mostly cosmetics though.
True if values are in the interval. False if not and strictness | ||
is set to 'warning'. Otherwise, it raises an exception. | ||
""" | ||
|
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.
Remove blank line.
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.
Still there
And alignment accordingly
8aeb8c2
to
8b584bb
Compare
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.
Mostly cosmetics
5d06f7c
to
4443df5
Compare
4443df5
to
0ac5006
Compare
True if values are in the interval. False if not and strictness | ||
is set to 'warning'. Otherwise, it raises an exception. | ||
""" | ||
|
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.
Still there
|
||
**kwargs: | ||
Optional arguments being passed to `in_range`. | ||
Returns |
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.
Returns | |
Returns |
add blank line before Returns
norm_value : Float(optional) | ||
If norm_strat is selected to be custom, user must provide the | ||
desired scale. | ||
Returns |
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.
Add blank line before Returns
norm_strat : NormStrategy | ||
Provides the desired normalization to be used. | ||
norm_value : Float(optional) | ||
If norm_strat is selected to be custom, user must provide the | ||
desired scale. |
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.
norm_strat : NormStrategy | |
Provides the desired normalization to be used. | |
norm_value : Float(optional) | |
If norm_strat is selected to be custom, user must provide the | |
desired scale. | |
norm_strat : NormStrategy, optional | |
Provides the desired normalization to be used. Default: NormStrategy.max. | |
norm_value : float, optional | |
If norm_strat is selected to be custom, user must provide the | |
desired scale. |
@given(float_arrays(size = 1, min_value = -198, max_value = 198), | ||
float_arrays(size = 1, min_value = -198, max_value = 198), | ||
float_arrays(size = 1, min_value = 0, max_value = 500), | ||
float_arrays(size = 1, min_value = 0, max_value = 100*1000)) |
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.
Remove unnecessary spaces after "size"
input_mask : Optional[np.ndarray] = None , | ||
eff_interval : Optional[Tuple[float, float]] = [0,1] , |
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 would remove the default value for these two arguments (and thus their Optional type hint)
norm_strat : Optional[NormStrategy] = NormStrategy.max, | ||
input_mask : Optional[np.ndarray] = None , | ||
range_DT : Optional[Tuple[np.ndarray, np.ndarray]] = (10, 1300) , | ||
range_E : Optional[Tuple[np.ndarray, np.ndarray]] = (10.0e+3,14e+3) , | ||
nsigma_sel : Optional[float] = 3.5 , | ||
eff_interval: Optional[Tuple[float, float]] = [0,1] , | ||
strictness : Optional[Strictness] = Strictness.raise_error |
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.
Of these, I think nsigma_sel
and strictness
could/should be optional, the rest I prefer that they are not. I'm not sure about norm_strat
, because there might be some assumptions in the code that are optimized for that choice. I think you will have a better feeling for that one.
nsigma_sel: float (Optional) | ||
Number of sigmas to set the band width. | ||
Defaults to 3.5. | ||
eff_interval (Optional) |
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.
eff_interval (Optional) | |
eff_interval: (float, float), optional |
eff_interval (Optional) | |
eff_interval: Tuple[float, float], optional |
Please keep on of these formats everywhere to make the style of the documentation consistent. We are heavily inspired by numpy's documentation, so in case of doubt, that is the reference.
def select_band(dt : np.ndarray , | ||
e : np.ndarray , | ||
range_dt : Tuple[float, float], | ||
range_e : Tuple[float, float], | ||
nsigma : Optional[float] = 3.5) ->np.ndarray: |
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.
def select_band(dt : np.ndarray , | |
e : np.ndarray , | |
range_dt : Tuple[float, float], | |
range_e : Tuple[float, float], | |
nsigma : Optional[float] = 3.5) ->np.ndarray: | |
def select_band(dt : np.ndarray , | |
e : np.ndarray , | |
range_dt : Tuple[float, float], | |
range_e : Tuple[float, float], | |
nsigma : Optional[float] = 3.5) ->np.ndarray: |
nsigma: float (Optional) | ||
Number of sigmas to set the band width | ||
Defaults to 3.5 | ||
Returns |
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.
Add blank line before Returns
This PR links to Issue #862 and presents a proposal for the set of functions to perform the data selection and checking for the preparation for the Kr map creation. However, there are a couple of things pending up for discussion: