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

Add ignore-case option to mepo whereis, update mepo-cd #213

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Jan 11, 2022

This PR adds a new option to mepo whereis, --ignore-case (or -i). This option, as it says, allows for a user to ignore the case of the component for whereis:

mepo whereis mapl
Traceback (most recent call last):
  File "/Users/mathomp4/bin/mepo", line 17, in <module>
    main()
  File "/Users/mathomp4/mepo/mepo.d/main.py", line 6, in main
    command.run(args)
  File "/Users/mathomp4/mepo/mepo.d/command/command.py", line 11, in run
    cmd_module.run(args)
  File "/Users/mathomp4/mepo/mepo.d/command/whereis/whereis.py", line 15, in run
    verify.valid_components([args.comp_name], allcomps, ignore_case=args.ignore_case)
  File "/Users/mathomp4/mepo/mepo.d/utilities/verify.py", line 23, in valid_components
    _validate_component(component_to_find, all_component_names)
  File "/Users/mathomp4/mepo/mepo.d/utilities/verify.py", line 35, in _validate_component
    raise Exception('Unknown component name [{}]'.format(component))
Exception: Unknown component name [mapl]mepo whereis -i mapl
src/Shared/@MAPL

The main use of this is in the mepo-cd helper functions/aliases where now a user doesn't need to know the exact case of a component:

pwd
/Users/mathomp4/Models/GEOSgcm-Intel2022.0-NewBaselib/GEOSgcmmepo-cd geoschem_gridcomppwd
/Users/mathomp4/Models/GEOSgcm-Intel2022.0-NewBaselib/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp

@mathomp4 mathomp4 added the enhancement New feature or request label Jan 11, 2022
@mathomp4 mathomp4 requested a review from a team as a code owner January 11, 2022 15:57
@mathomp4 mathomp4 self-assigned this Jan 11, 2022
@mathomp4 mathomp4 marked this pull request as draft January 11, 2022 18:51
@mathomp4 mathomp4 marked this pull request as ready for review January 11, 2022 19:05
@mathomp4
Copy link
Member Author

I broke mepo diff with my first try. Fixed now. 😊

@mathomp4 mathomp4 merged commit 2f2061d into develop Jan 12, 2022
@mathomp4 mathomp4 deleted the feature/mathomp4/case-insensitive-components branch January 12, 2022 13:52
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.

1 participant