-
Notifications
You must be signed in to change notification settings - Fork 15
New CLI for MDIO v1 with lots of interactivity #728
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
base: main
Are you sure you want to change the base?
Conversation
…en required fields are missing
…ng, and support storage options
…ling of storage options
…e mode and error handling improvements
…_input/output` for clarity
… tests for more specific error handling
…xclude command from pydoclint checks
BrianMichell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just took a quick pass over this
| def prompt_for_segy_standard() -> SegyStandard: | ||
| """Prompt user to select a SEG-Y standard.""" | ||
| choices = list(REVISION_MAP.keys()) | ||
| standard_str = questionary.select("Select SEG-Y standard:", choices=choices, default="rev 1").ask() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| standard_str = questionary.select("Select SEG-Y standard:", choices=choices, default="rev 1").ask() | |
| standard_str = questionary.select("Select SEG-Y standard:", choices=choices, default=str(SegyStandard.REV1)).ask() |
|
|
||
| def prompt_for_text_encoding() -> str: | ||
| """Prompt user for text header encoding.""" | ||
| return questionary.select("Select text header encoding:", choices=["ebcdic", "ascii"], default="ebcdic").ask() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to pull the choices into a list similar to REVISION_MAP?
src/mdio/commands/segy.py
Outdated
| except ValueError: | ||
| print(f"Invalid {field_type} field spec '{custom_field}'. Use format: name,byte,format") | ||
| continue | ||
| if questionary.confirm("Done adding fields?", default=True).ask(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if questionary.confirm("Done adding fields?", default=True).ask(): | |
| if questionary.confirm("Done adding fields?", default=False).ask(): |
User is likely to add more than one field.
| raise typer.Abort from None | ||
|
|
||
|
|
||
| SegyOutType = Annotated[UPath, typer.Argument(help="Path to the input SEG-Y file.", click_type=UPathParamType())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| SegyOutType = Annotated[UPath, typer.Argument(help="Path to the input SEG-Y file.", click_type=UPathParamType())] | |
| SegyInType = Annotated[UPath, typer.Argument(help="Path to the input SEG-Y file.", click_type=UPathParamType())] |
| storage_options_output: dict[str, Any], | ||
| overwrite: bool, | ||
| grid_overrides: dict[str, Any], | ||
| input_path: SegyOutType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| input_path: SegyOutType, | |
| input_path: SegyInType, |
No description provided.