Add data preparation functions for the Kr map computation#865
Add data preparation functions for the Kr map computation#865bpalmeiro wants to merge 53 commits into
Conversation
16d65f1 to
0741041
Compare
|
Some comments:
Tests:
|
0741041 to
b0f7f55
Compare
d287075 to
4578a4b
Compare
gonzaponte
left a comment
There was a problem hiding this comment.
First round. This is being done with peras, more or less.
9520347 to
a898d85
Compare
gonzaponte
left a comment
There was a problem hiding this comment.
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. | ||
| """ | ||
|
|
And alignment accordingly
8aeb8c2 to
8b584bb
Compare
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. | ||
| """ | ||
|
|
|
|
||
| **kwargs: | ||
| Optional arguments being passed to `in_range`. | ||
| Returns |
There was a problem hiding this comment.
| 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.
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.
| 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.
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.
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.
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.
| 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.
| 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.
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: