assume-framework / assume

ASSUME - Agent-based Simulation for Studying and Understanding Market Evolution
https://assume.readthedocs.io
22 stars 5 forks source link

add fancy completion using argcomplete #251

Closed maurerle closed 10 months ago

maurerle commented 10 months ago

While watching an interesting talk about tab-completion I tried to set this up for assume too.

Screencast from 2023-11-12 14-46-15.webm

This suggests possible database paths and scenarios, as well as parameters for case_study based on the context. By moving the script to the top folder, assume does not need to be imported if only calling the --help for example.

This should also work on macOS by running:

pip install -e . eval "$(register-python-argcomplete assume)"

And also for Powershell on Windows using:

register-python-argcomplete --shell powershell assume | Out-String | Invoke-Expression (though I did not test it)

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (53c7563) 78.28% compared to head (fa4234e) 78.23%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #251 +/- ## ========================================== - Coverage 78.28% 78.23% -0.05% ========================================== Files 40 39 -1 Lines 4242 4214 -28 ========================================== - Hits 3321 3297 -24 + Misses 921 917 -4 ``` | [Flag](https://app.codecov.io/gh/assume-framework/assume/pull/251/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | Coverage Δ | | |---|---|---| | [pytest](https://app.codecov.io/gh/assume-framework/assume/pull/251/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | `78.23% <100.00%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/assume-framework/assume/pull/251?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | Coverage Δ | | |---|---|---| | [assume/common/scenario\_loader.py](https://app.codecov.io/gh/assume-framework/assume/pull/251?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework#diff-YXNzdW1lL2NvbW1vbi9zY2VuYXJpb19sb2FkZXIucHk=) | `88.83% <100.00%> (+0.05%)` | :arrow_up: | | [assume/world.py](https://app.codecov.io/gh/assume-framework/assume/pull/251?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework#diff-YXNzdW1lL3dvcmxkLnB5) | `82.35% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/assume-framework/assume/pull/251/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.