-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
class Foldernames and user guide snippet #669
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jose Borreguero <[email protected]>
@jbednar @philippjfr @jlstevens Hi, would you consider adding this |
Thanks! It does seem reasonable to support multiple folder names. Is there a good reason to allow or support a single string rather than always requiring a list and returning a list for |
We had a request from a User for a parameter allowing one to pass either one or multiple directories to it. In the case of one directory, it's true I could always pass a one-item list, i.e, |
The problem is that a user of this parameter would then always have to check if it was a list or not, when actually accessing the value. The way around that would be to promote a single item provided into a one-item list before storing it or at least before accessing it, which seems ok. |
If I understand you, the interface would be:
I think this interface is better because, as you say, you know in advance the type you'll get. If that sounds OK by you, then I'll make the changes (and hopefully fix the tests 🙂 ) |
Sounds good, thanks! |
Signed-off-by: Jose Borreguero <[email protected]>
@jbednar can you please take a second look? def _resolve(self, paths: FlexPaths): I assume it's because of the type hint. Should I remove all type hints so that the code can support the deprecated python 2.7 🙀 ? |
And yes, we haven't yet dropped Python 2.7 support in Param, so please remove py3 syntax until we release Param 2.0. |
Signed-off-by: Jose Borreguero <[email protected]>
Signed-off-by: Jose Borreguero <[email protected]>
Signed-off-by: Jose Borreguero <[email protected]>
I removed the Python type hints |
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.
Looks good! almost ready to merge. If you want this merged in a 1.X release, we'd have to make importing pathlib conditional. Otherwise, for param 2.0
Signed-off-by: Jose Borreguero <[email protected]>
I think better leave it for param 2.0. In this case, should the PR be against other branch than |
No, I think the plan is for us to release a last patch or minor release for 1.x pretty soon and then create a |
It's OK by me if this is implemented in |
I see this is allowing pathlib.Path paths, which is great, but I'd like Param to accept that consistently where it makes sense and not just in some Parameters. Also, if we add |
Signed-off-by: Jose Borreguero [email protected]