iris.pandas.as_data_frame() n-dimensional Cube conversion#5074
Merged
stephenworsley merged 10 commits intomainfrom Nov 17, 2022
Merged
iris.pandas.as_data_frame() n-dimensional Cube conversion#5074stephenworsley merged 10 commits intomainfrom
iris.pandas.as_data_frame() n-dimensional Cube conversion#5074stephenworsley merged 10 commits intomainfrom
Conversation
* Added pandas_ndim FUTURE flag. * TODO flag to document pandas_ndim future flag.
* Update as_data_frame() * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Minor typo fixes * Matching data raveling with dimension meshgrid * Revise test_simple to check long-syle dataframe * Revise NaN and 1D dataframe tests * Better pandas.MultiIndex solution * Add 3D test case * Fixes for cube with partially defined dims * Update tests for partially defined dims * Update time tests * Reuse _as_pandas_coord() * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove Series conversion * Remove option for copy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * First go at adding aux coords * First go at adding global attributes * Update doc string * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix for time based AuxCoords * Minor misc fixes * Fix copy issue * Fix black weirdness and add copy tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add attributes test * Name fixes * Add AuxCoord test * Improved aux coord indexing * Blacking * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Preserve index on aux coord merge * Simplify adding AuxCoords * Add assertRaises test for attributes * Better dim coord making logic * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updates to docstring * Handle multidim AuxCoords * Add handling for AuxCoords + scalar coord info * Fix STASH attribute handling * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Improve and simplify dim extraction * Re-fix copy behaviour * Doc updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add Series example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * What's New update * Add `as_series` depreciation warning * Fix indent * flake8 fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix deprecation warning Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * Fix pytest styles Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * Fix pytest styles Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * Minor syntax change to list Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * Update error style Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * Fix error type * Reinstate copy warning behaviour * Add author link * Remove add_global_attribute code * Further global attribute code removal * Add instance checking test * Improve _make_dim_coord_list efficiency * Correct list ouput * Make tests more efficient * Add scalar coordinate test * Docstring fixes * Refactor making of aux_coord_list * Fix type error * Add masked array -> nan warning in doc * Consolidate use of `_as_pandas_coord` * Roll back breaking _make_dim_coord_list changes * Raise error for Ancillary variables without dims * Ancillary variables tweaks * Ancillary variables tests * Split out metadata for consistency with `as_cubes` * Add cell_measure tests * Docstring fixes * Test kwarg fixes * `_make_aux_coord_list` optimisation * Refactor metadata merging * Roundabout :issue: fix (remove) * Roundabout :issue: fix (re-add) * Docstring typo fixes Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * Fix doctests * Update docs/src/whatsnew/latest.rst Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Further doctest fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>
* iris.pandas.as_data_frame doctests full width. * NetCDF4 pin to enable RTD build. * Revert "NetCDF4 pin to enable RTD build." This reverts commit 31f5ea6.
) * Restore original as_data_frame behaviour, with new behaviour as opt-in. * Document and test opt-in nature of mulit-d as_data_frame behaviour. * Test fixes. * Update for Pandas 1.5 deprecation. * More explicit What's New. * Fix int64 test. * added link to the docs archive. (#5064) * added link to the docs archive. * added whatsnew Co-authored-by: tkknight <2108488+tkknight@users.noreply.github.com>
Update `pandas_ndim` branch from `main`
trexfeathers
commented
Nov 17, 2022
Contributor
|
I think merging without squashing is probably the proper way to go here, I think the only practical difference would be that the blame would point to the individual PRs, but there seems to be enough discussion in those extra PRs that this is worthwhile. I think #4669 is still the most important PR to mention in the whatsnew since it was authored by @hsteptoe, but perhaps you could also add a reference to this PR for completeness. With merging, I think the changes to the whatsnew are probably better done as a PR so that we aren't left with direct commits in the history. |
Update `pandas_ndim` feature branch again.
stephenworsley
approved these changes
Nov 17, 2022
Contributor
stephenworsley
left a comment
There was a problem hiding this comment.
Good job! I think this is all good to merge in now.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
Description
This finally merges @hsteptoe's brilliant work from the
pandas_ndimfeature branch, allowingas_data_frame()to convertCubes of any dimensionality to pandasDataFrames, complete with optional dimensional metadata.Questions
#5074), rather than#4669?(Guessing that would mean another tiny PR targeting
pandas_ndim).Consult Iris pull request check list