Conversation
|
|
|
Would you add a note on this in the User-Defined Constraint tutorial? |
astroplan/constraints.py
Outdated
| above = rescaled > 1 | ||
| rescaled[below] = 0 | ||
| rescaled[above] = 1 | ||
| def min_best_rescale(vals, min_val, max_val, greater_than=0, less_than=1): |
There was a problem hiding this comment.
How about naming the last two arguments (which might be just one if you make the changes I'm about to discuss in the comments) as "greater_score or similar? That makes it clearer that you're saying what the output is, rather than what input value is.
Similarly, perhaps you should use the word "score" in the docstring. E.g.
Rescales the input array ``vals`` to be a score (between zero and one), where ``min_val``
is the best and ``max_val`` is whatever ``greater_score`` is.
|
This was discussed in a google hangout, but just to leave a note here on the topic: I'd suggest dropping the argument of whichever of In general, though, I'm 👍 on having the two separate functions. Much easier to understand. |
|
I changed the docstring. I still need to add it into the constraints tutorial. |
|
I changed the constraint tutorial to contain a non-boolean constraint that uses the |
astroplan/constraints.py
Outdated
| max_val : value | ||
| best value cared about (rescales to 1) | ||
| less_than_min : 0 or 1 | ||
| what is returned for ``vals`` below min_val. (in some cases |
There was a problem hiding this comment.
Would you put double ticks around min_val on this line?
|
I changed the parameter types to "array-like" and "float" and ``ed the min_val and max_val. |
|
Thanks @kvyh! |
This is an alternate form of #228, with different functions for when the score gets better or worse for larger values. Would this be better than the single function in #228?