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

extension/cli #24

Merged
merged 44 commits into from
Jun 7, 2021
Merged

extension/cli #24

merged 44 commits into from
Jun 7, 2021

Conversation

HerrHorizontal
Copy link
Contributor

This is a draft for the simulate CLI. It expands the already existent CLI script to support additional choices in the defintion of the simulator object related to caching.

@pep8speaks
Copy link

pep8speaks commented May 12, 2021

Hello @HerrHorizontal! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-06-07 09:51:16 UTC

@HerrHorizontal HerrHorizontal requested review from tfesenbecker, eileen-kuehn and maxfischer2781 and removed request for tfesenbecker May 12, 2021 15:38
@HerrHorizontal HerrHorizontal self-assigned this May 12, 2021
@HerrHorizontal HerrHorizontal added the enhancement New feature or request label May 12, 2021
@eileen-kuehn
Copy link
Member

@HerrHorizontal, thanks for this PR. I have one general comment before going into detail.
Did you check that none of these CLI methods is used in one of the scripts from Tabea? As long as we cannot guarantee I would recommend adding the functions that you require instead of updating the name of arguments. On this way none of the existing scripts would break.

@HerrHorizontal
Copy link
Contributor Author

@HerrHorizontal, thanks for this PR. I have one general comment before going into detail.
Did you check that none of these CLI methods is used in one of the scripts from Tabea? As long as we cannot guarantee I would recommend adding the functions that you require instead of updating the name of arguments. On this way none of the existing scripts would break.

So the changes related to this PR did only affect the behavior in the cli/simulate.py script, which isn't used in the scripts written by @tfesenbecker. She solely relies on the custom_simulate.py script, which except for some cosmetic changes, hasn't changed at all.

Indeed, the cli/simulate.py script is meant to replace the custom_simulate.py by mimicking the behavior of the latter.

Copy link
Member

@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got some individual suggestions in a few places. Overall, please follow Eileen's request to factor out duplicated code.

lapis/cli/simulate.py Outdated Show resolved Hide resolved
lapis/cli/simulate.py Outdated Show resolved Hide resolved
@HerrHorizontal
Copy link
Contributor Author

Got some individual suggestions in a few places. Overall, please follow Eileen's request to factor out duplicated code.

Done

Copy link
Member

@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these changes.

Now that the common code has been factored out of the CLI, I am having a hard time finding out what is actually different about them. As far as I can tell, static/dynamic uses --pool-files as static_pool_files/dynamic_pool_files whereas hybrid has separate --static-pool-files and --dynamic-pool-files. Is that correct?
If that's the only change, I don't think that's worth having three quasi-equivalent CLIs. Just implement only the hybrid and people can still get the static/dynamic behaviour by just not providing the other file type.

lapis/scheduler.py Show resolved Hide resolved
lapis/simulator.py Show resolved Hide resolved
@HerrHorizontal
Copy link
Contributor Author

Thanks for these changes.

Now that the common code has been factored out of the CLI, I am having a hard time finding out what is actually different about them. As far as I can tell, static/dynamic uses --pool-files as static_pool_files/dynamic_pool_files whereas hybrid has separate --static-pool-files and --dynamic-pool-files. Is that correct?
If that's the only change, I don't think that's worth having three quasi-equivalent CLIs. Just implement only the hybrid and people can still get the static/dynamic behaviour by just not providing the other file type.

So yes you are right. The only difference is in the pool type and the subsequent creation of the pool in the simulator (the pool_type and controller differ).

Copy link
Member

@eileen-kuehn eileen-kuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your deduplication efforts, this helps a lot.
As @maxfischer2781 already mentioned it might be great to reduce the cli to just one command as the hybrid function manages to set up the whole simulation 👍
In case you are integrating your create_simulator function back into the hybrid function you can also ignore the comment on adding type hints.

lapis/cli/simulate.py Outdated Show resolved Hide resolved
lapis/simulator.py Show resolved Hide resolved
lapis/cli/simulate.py Outdated Show resolved Hide resolved
@HerrHorizontal
Copy link
Contributor Author

Thanks for these changes.

Now that the common code has been factored out of the CLI, I am having a hard time finding out what is actually different about them. As far as I can tell, static/dynamic uses --pool-files as static_pool_files/dynamic_pool_files whereas hybrid has separate --static-pool-files and --dynamic-pool-files. Is that correct?
If that's the only change, I don't think that's worth having three quasi-equivalent CLIs. Just implement only the hybrid and people can still get the static/dynamic behaviour by just not providing the other file type.

In this case we don't need the group (static, dynamic, hybrid) anymore, aren't we? We could just work with a single command.

Copy link
Member

@eileen-kuehn eileen-kuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if you want another review already.
From my point of view the code is good to go now 👍

@HerrHorizontal
Copy link
Contributor Author

Thanks for these changes.
Now that the common code has been factored out of the CLI, I am having a hard time finding out what is actually different about them. As far as I can tell, static/dynamic uses --pool-files as static_pool_files/dynamic_pool_files whereas hybrid has separate --static-pool-files and --dynamic-pool-files. Is that correct?
If that's the only change, I don't think that's worth having three quasi-equivalent CLIs. Just implement only the hybrid and people can still get the static/dynamic behaviour by just not providing the other file type.

In this case we don't need the group (static, dynamic, hybrid) anymore, aren't we? We could just work with a single command.

I have further simplified the CLI by getting rid of the unnecessary subcommand. @eileen-kuehn, @maxfischer2781 could you please review?

Copy link
Member

@eileen-kuehn eileen-kuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go 👍

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

Successfully merging this pull request may close these issues.

Chosing the caching scenario via CLI
4 participants