Skip to content

feat: Add shef in file export, update shef command#196

Open
msweier wants to merge 6 commits intomainfrom
shef_export
Open

feat: Add shef in file export, update shef command#196
msweier wants to merge 6 commits intomainfrom
shef_export

Conversation

@msweier
Copy link
Copy Markdown
Collaborator

@msweier msweier commented Apr 9, 2026

This adds an importer for ".in" files that were read into exportShef.py and refactors the crit file import so both commands live under cwms-cli shef. I was able to test the .in file but don't have a good example for .crit import. That needs testing. Also, I'm guessing there is documentation I need to update? Not sure how that works.

msweier added 3 commits April 9, 2026 13:05
Convert shefcritimport and shefinimport to use a 'shef' command group with
'import_crit' and 'import_infile' subcommands. Move implementation files to
cwmscli/commands/shef/ directory:
- cwmscli/commands/shef_critfile_import.py → cwmscli/commands/shef/import_critfile.py
- cwmscli/commands/shef_infile_import.py → cwmscli/commands/shef/import_infile.py

This aligns with the existing blob/clob command structure for better organization.

Usage changes:
  cwms-cli shefcritimport  → cwms-cli shef import_crit
  cwms-cli shefinimport    → cwms-cli shef import_infile
@msweier msweier requested review from Enovotny and krowvin as code owners April 9, 2026 19:08
@msweier msweier marked this pull request as draft April 9, 2026 19:08
@msweier msweier changed the title Add shef in file export, update shef command PATCH: Add shef in file export, update shef command Apr 9, 2026
@Enovotny Enovotny changed the title PATCH: Add shef in file export, update shef command feat: Add shef in file export, update shef command Apr 9, 2026
# ---------------------------------------------------------------------------


def _build_parser() -> argparse.ArgumentParser:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't think any of this is needed. arguments should be handled by click.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep good point

return p


def main(argv: Optional[list] = None) -> int:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

none of this is likely needed either since the cwms-cli is calling import_shef_infile which skips all of this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yep

"Default: silently update the existing group."
),
)
p.add_argument(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

might want to add dry run option to the import_shef_infile.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good idea!

@msweier msweier marked this pull request as ready for review April 10, 2026 14:57
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

Successfully merging this pull request may close these issues.

2 participants