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

Figure.meca: Refactor to improve the processing of the input data #3831

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

seisman
Copy link
Member

@seisman seisman commented Mar 4, 2025

Extract two private functions _preprocess_spec and _set_offset to simplify the main Figure.meca function, so that the Figure.coupe function (#3817) can be much simplified if we decide to have a separate Figure.coupe function.

The main logic of codes is close to the original ones, but the codes are much simplified. The most significant difference is that, previously, we converted spec to a pandas.DataFrame object if possible, but now we convert spec to a dict instead. A dict is very similar to a pandas.DataFrame object, but the pd.DataFrame->dict conversion is more efficient than the dict->pd.DataFrame conversion.

@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. run/benchmark Trigger the benchmark workflow in PRs labels Mar 4, 2025
@seisman seisman added this to the 0.15.0 milestone Mar 4, 2025
@seisman seisman force-pushed the refactor/meca_in branch from 0089020 to bd0ccfa Compare March 4, 2025 01:27
@michaelgrund michaelgrund 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. labels Mar 5, 2025
@seisman seisman merged commit e7372be into main Mar 7, 2025
24 checks passed
@seisman seisman deleted the refactor/meca_in branch March 7, 2025 00:57
@seisman seisman removed final review call This PR requires final review and approval from a second reviewer run/benchmark Trigger the benchmark workflow in PRs labels Mar 7, 2025
@seisman seisman mentioned this pull request Mar 7, 2025
9 tasks
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.

2 participants