Skip to content
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

modification of the apps functions #90

Open
3 tasks
untereiner opened this issue Jun 15, 2020 · 3 comments
Open
3 tasks

modification of the apps functions #90

untereiner opened this issue Jun 15, 2020 · 3 comments
Assignees

Comments

@untereiner
Copy link

untereiner commented Jun 15, 2020

Hi, I am using h5pyd in a higher-level program. The logic implemented in the so called apps is interesting. I think they would be useful as functions that take parameters to be reused in other programms.
What do you think ?
Here a listed the two main modifications I think must be done:

  • stateless: init cfg structure in the main function and put it as a parameter to the functions (PR put config object as parameter to functions #91)
  • arguments: use the argparse package to handle arguments
  • transform the logic implented in the main functions of the apps in functions that take parameters (the same as those from the argv) from a new main function.

I can contribute via a PR if you are interested.

@MRossol
Copy link
Contributor

MRossol commented Jun 15, 2020

@untereiner I started to convert the hsload app to OOP which might be similar to what you are
suggesting. My efforts are attached if you want to use it in your PR (I'd also be happy to help/contribute).
hsload.py.zip

@jreadey
Copy link
Member

jreadey commented Jun 15, 2020

@untereiner - this sounds like a great idea for refactoring the code in _apps. Looking forward to a PR.

One challenge we've had with the apps is that there are no test codes, so it's easy for regressions to slip in. If the refactor made it easier to write test cases, so much the better.

@untereiner
Copy link
Author

Thank you both !
@MRossol I will look into your work!
@jreadey I will try to refactor in a way to simplify the test suite writing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants