Skip to content

Conversation

seisman
Copy link
Member

@seisman seisman commented Feb 22, 2025

In the previous version, _validate_data_input is called at the start of the Session.virtualfile_in method. It's defined like below:

def _validate_data_input(                                              
    data=None, x=None, y=None, z=None, required=True, mincols=2, kind=None              
)

So, it's responsible for:

  • Checking if the combinations of data/x/y/z are valids
  • Checking if the z column is available when required

Since data can be different types, e.g., list, 2-D numpy array, pandas.DataFrame, xr.Dataset, dict, making the function complicated to maintain.

This PR tries to simplify the _validate_data_input function.

@seisman seisman force-pushed the refactor/validate_data_input branch from e4cc57d to 9672f05 Compare February 22, 2025 16:04
@seisman seisman changed the title Refactor _validate_data_input Refactor _validate_data_input to simplify the codes Feb 22, 2025
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. labels Feb 22, 2025
@seisman seisman added this to the 0.15.0 milestone Feb 22, 2025
@seisman seisman marked this pull request as ready for review February 22, 2025 16:13
@seisman seisman removed the needs review This PR has higher priority and needs review. label Feb 22, 2025
@seisman seisman marked this pull request as draft February 22, 2025 16:37
@seisman seisman force-pushed the refactor/validate_data_input branch from 9672f05 to 839caa1 Compare February 25, 2025 02:32
@seisman seisman force-pushed the refactor/validate_data_input branch from ccb74d0 to 963c9ae Compare March 4, 2025 06:44
@seisman seisman modified the milestones: 0.15.0, 0.16.0 Mar 6, 2025
@seisman seisman removed this from the 0.16.0 milestone Apr 1, 2025
@seisman seisman force-pushed the refactor/validate_data_input branch from 963c9ae to ea367c8 Compare April 15, 2025 04:51
@seisman seisman changed the base branch from main to refactor/virtualfile_in April 15, 2025 06:26
Base automatically changed from refactor/virtualfile_in to main April 28, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant