Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Apr 22, 2024

For some module wrappers, output_type="numpy" makes no sense (e.g., #3182 (comment)).

This PR adds a new parameter valid_types to the validate_output_table_type function. It defaults to ('pandas', 'numpy', 'file'). If a module wrapper doesn't support numpy, then just set valid_types=('pandas', 'file').

@seisman seisman added the enhancement Improving an existing feature label Apr 22, 2024
@seisman seisman added this to the 0.12.0 milestone Apr 22, 2024
@seisman seisman force-pushed the validator/valid-types branch from ec0f518 to 28eb1df Compare April 22, 2024 06:02
Comment on lines +66 to +67
+ ", ".join(f"'{v}'" for v in valid_types[:-1])
+ f", or '{valid_types[-1]}'."
Copy link
Member Author

Choose a reason for hiding this comment

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

These two lines convert a list/tuple like ("pandas", "numpy", "file") to a string like 'pandas', 'numpy', or 'file', which is useful for raising a warning or error.

Perhaps we should wrap it as a utility function so that it can be reused.

Copy link
Member

Choose a reason for hiding this comment

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

Ok to leave this as is for now.

@seisman seisman changed the title Let validate_output_table_type specify the supported output types Allow validate_output_table_type to specify the supported output types Apr 25, 2024
@seisman seisman added the needs review This PR has higher priority and needs review. label Apr 25, 2024
@seisman seisman removed this from the 0.12.0 milestone Apr 29, 2024
@seisman seisman added this to the 0.13.0 milestone May 6, 2024
Comment on lines +66 to +67
+ ", ".join(f"'{v}'" for v in valid_types[:-1])
+ f", or '{valid_types[-1]}'."
Copy link
Member

Choose a reason for hiding this comment

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

Ok to leave this as is for now.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. final review call This PR requires final review and approval from a second reviewer labels May 6, 2024
@seisman seisman merged commit a4d2b8e into main May 7, 2024
@seisman seisman deleted the validator/valid-types branch May 7, 2024 01:11
seisman added a commit that referenced this pull request May 7, 2024
@seisman seisman added the skip-changelog Skip adding Pull Request to changelog label May 7, 2024
seisman added a commit that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants