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

Explicit indexes #5692

Merged
merged 168 commits into from
Mar 17, 2022
Merged

Explicit indexes #5692

merged 168 commits into from
Mar 17, 2022

Commits on Aug 11, 2021

  1. Configuration menu
    Copy the full SHA
    6ccebeb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6d5c79d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4742100 View commit details
    Browse the repository at this point in the history
  4. update multi-index (text) repr

    Notes:
    
    - move the multi-index formatting logic into
      PandasMultiIndexingAdapter._repr_inline_
    - inline repr: check for _repr_inline_ implementation first
    benbovy committed Aug 11, 2021
    Configuration menu
    Copy the full SHA
    55dd9d9 View commit details
    Browse the repository at this point in the history
  5. remove print

    benbovy committed Aug 11, 2021
    Configuration menu
    Copy the full SHA
    752a405 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2021

  1. minor fixes and improvements

    benbovy committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    1250ccf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1bb61d9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a551c7f View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2021

  1. Configuration menu
    Copy the full SHA
    abc3384 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    92c8ca4 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2021

  1. Configuration menu
    Copy the full SHA
    b9e1cba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    60935ac View commit details
    Browse the repository at this point in the history
  3. get rid of multi-index virtual coordinates

    Not totally yet: need to refactor set_index / reset_index
    benbovy committed Aug 23, 2021
    Configuration menu
    Copy the full SHA
    3086d4e View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2021

  1. Configuration menu
    Copy the full SHA
    54a04f7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e3181d4 View commit details
    Browse the repository at this point in the history
  3. collect index for multi-index level variables

    Avoid re-creating the indexes for dimension variables. Collect then
    directly instead.
    
    Note: the change here is working for building new Datasets but I haven't
    checked other cases like merging different objects, etc. So I'm not sure
    this is the right approach.
    benbovy committed Aug 25, 2021
    Configuration menu
    Copy the full SHA
    81a60f6 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2021

  1. wip refactor label based selection

    - Index.query must now return a mapping of {dim_name:
    positional_indexer} as indexes may be based on several coordinates with
    different dimensions
    
    - Added `group_coords_by_index` utility function (not used yet, not sure
    we'll need it)
    
    TODO:
    
    - Update DataArray selection
    - Update .loc and other places using remap_label_indexers
    - Fix selection of multi-index that returns only scalar coordinates
    benbovy committed Aug 26, 2021
    Configuration menu
    Copy the full SHA
    2e4a041 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2021

  1. fix index query tests

    benbovy committed Aug 27, 2021
    Configuration menu
    Copy the full SHA
    f387c70 View commit details
    Browse the repository at this point in the history
  2. fix multi-index adapter getitem scalar

    Multi-index level variables now return the scalar value that corresponds
    to the level instead of the multi-index tuple element (all levels).
    
    Also get rid of PandasMultiIndexingAdapter.__getitem__ cache
    optimization, which doesn't work with level scalar values and was
    premature optimization anyway.
    benbovy committed Aug 27, 2021
    Configuration menu
    Copy the full SHA
    6a9dbd6 View commit details
    Browse the repository at this point in the history
  3. wip refactor label based selection

    Fixed renamed dimension in the case of multi-index -> single index
    
    Updated DataArray._overwrite_indexes
    
    Dirty fix for alignment (not tested yet)
    benbovy committed Aug 27, 2021
    Configuration menu
    Copy the full SHA
    64b71c9 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2021

  1. wip: deeper refactoring label-based sel

    Created QueryResult and MergedQueryResults classes for convenience.
    benbovy committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    f3116ac View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2021

  1. fix some tests + minor tweaks

    benbovy committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    3ca6a02 View commit details
    Browse the repository at this point in the history
  2. fix indexing PandasMultiIndexingAdapater

    When level is not None:
    
    - if result is another adapter: propagate it properly
    - if result is a numpy adapter: use level values
    benbovy committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    05c488d View commit details
    Browse the repository at this point in the history
  3. refactor cast label indexer to coord dtype

    Make the fix in pydata#3153 specific to pandas indexes (i.e., do not apply it
    to other, custom indexes). See pydata#5697 for details.
    
    This should also fix pydata#5700 although no test has been added yet (we need
    to refactor set_index first).
    benbovy committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    cc2d9c9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1588824 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a8d84c7 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2021

  1. label-based selection tweaks and fixes

    - Use a dataclass for QueryResult
    
    - Pass Variables and DataArrays indexers un-normalized to Index.query().
      Indexes have the responsibility of returning the expected types for
      positional (dimension) indexers by adding back dimensions and
      coordinates if needed.
    
    - Typing fixes and tweaks
    benbovy committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    a6bce37 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ad17931 View commit details
    Browse the repository at this point in the history
  3. wip refactor rename

    Still needs tests
    
    Also need to address the problem of multi-index level coordinates (data
    adapters currently not updated). We'll probably need for
    `Index.rename()` to also return new index variables?
    benbovy committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    b894f8d View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2021

  1. Configuration menu
    Copy the full SHA
    e42e324 View commit details
    Browse the repository at this point in the history
  2. refactor rename: update tests

    Still need to address default indexes internal checks (these are
    disabled for now).
    benbovy committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    5febd7f View commit details
    Browse the repository at this point in the history
  3. typing tweaks

    benbovy committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    508cdcc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f1535a3 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2021

  1. Configuration menu
    Copy the full SHA
    d5cc3b4 View commit details
    Browse the repository at this point in the history
  2. minor fixes and tweaks

    benbovy committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    021090f View commit details
    Browse the repository at this point in the history
  3. wip refactor set_index

    benbovy committed Sep 13, 2021
    Configuration menu
    Copy the full SHA
    0086e32 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2021

  1. wip refactor set_index

    - Refactor reset_index
    - Improve creating new xarray indexes from pandas indexes with proper
      propagation of variable metadata (dtype, attrs, encoding)
    benbovy committed Sep 14, 2021
    Configuration menu
    Copy the full SHA
    a891e22 View commit details
    Browse the repository at this point in the history
  2. refactor reorder_levels

    benbovy committed Sep 14, 2021
    Configuration menu
    Copy the full SHA
    e50978e View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2021

  1. Set pd.MultiIndex name from dim name

    benbovy committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    8b1e4d5 View commit details
    Browse the repository at this point in the history
  2. .sel() with multi-index: return scalar coords

    ..instead of dropping those coordinates
    
    Closes pydata#1408 once tests are fixed/updated
    benbovy committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    e2075b7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4fbdc86 View commit details
    Browse the repository at this point in the history
  4. wip refactor stack

    Some changes:
    
    Multi-indexes are created only if the
    stacked dimensions each have a single coordinate index. In the other
    cases, multi-indexes are not created, which means that it is an
    irreversible operation (unstack will not work)
    
    Multi-indexes are created from the stacked coordinate variables and not
    anymore from the unstacked dimension indexes (level product). There's a
    significant decrease in performance but it is probably acceptable since
    it's now possible to avoid the creation of multi-indexes.
    
    It is possible to stack a dimension with a multi-index, but it drops the
    index. Otherwise it would make it hard for unstack() to figure out
    what's going on. It makes it clear that this is an irreversible
    operation.
    benbovy committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    ef6fbbd View commit details
    Browse the repository at this point in the history
  5. stack: better rule for add/skip multi-index

    It is more robust and allows creating a multi-index from
    non-default (non-dimension) coordinates, as long as there's one and only
    one 1-d indexed coordinate for each dimension to stack.
    benbovy committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    8bc2590 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2021

  1. add utility methods to class Indexes

    This removes some ugly & duplicate patterns.
    benbovy committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    64df1e9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    da8846d View commit details
    Browse the repository at this point in the history
  3. wip refactor stack / unstack

    stack: revert to old way of creating multi-index
    
    unstack: support non-default (non-dimension) multi-index (as long as
    there is exactly one multi-index per specified dimension)
    benbovy committed Sep 16, 2021
    Configuration menu
    Copy the full SHA
    28ecad6 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2021

  1. add PandasMultiIndex.from_product_variables

    Refactored utils.multiindex_from_product_levels utility function
    into a new PandasMultiIndex classmethod.
    benbovy committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    e62b9cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f7aca70 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2021

  1. wip: fix/update tests

    benbovy committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    e44c56e View commit details
    Browse the repository at this point in the history
  2. fix/refactor reindex

    benbovy committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    f88c2c2 View commit details
    Browse the repository at this point in the history
  3. functools.cached_property is since py38

    Use the good old way as we still support py37
    benbovy committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    1daaf8d View commit details
    Browse the repository at this point in the history
  4. update reset_coords

    benbovy committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    41ebc45 View commit details
    Browse the repository at this point in the history
  5. fix ipython key completion test

    make sure the stacked dataset used has a multi-index
    benbovy committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    e750883 View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2021

  1. update test_map_index_queries

    benbovy committed Sep 27, 2021
    Configuration menu
    Copy the full SHA
    6c6f09e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6437e13 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2021

  1. add Index.create_variables() method

    This will probably be used instead of including index coordinate
    variables in the signature (return type) of many methods of ``Index``.
    
    It has several advantages:
    
    - More DRY, and for custom indexes that do not need to create coordinate
    variables with special data adapters, it's easier to just skip
    implementing this method and not bother with returning empty dicts in
    other methods
    
    - This allows to decouple index vs. coordinates creation. For many cases
    this can be done at the same time but for some cases like alignment this
    is useful
    
    - It's a more elegant solution when we need to propagate
    metadata (attrs, encoding)
    benbovy committed Oct 13, 2021
    Configuration menu
    Copy the full SHA
    a955d45 View commit details
    Browse the repository at this point in the history
  2. improve Dataset/DataArray indexes proxy class

    One possible solution to the recurring problem of accessing coordinate
    variables related to a given index in some of Xarray's internals.
    
    I feel that the ``Indexes`` proxy is the right place for storing
    references to those indexed coordinate variables. It's safer than
    relying on a public attribute/property of ``Index``.
    benbovy committed Oct 13, 2021
    Configuration menu
    Copy the full SHA
    c87586e View commit details
    Browse the repository at this point in the history
  3. align Indexes API with Coordinates API

    Expose similar properties:
    - variables
    - dims
    benbovy committed Oct 13, 2021
    Configuration menu
    Copy the full SHA
    db65e44 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    417f1f4 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2021

  1. wip: refactor alignment

    benbovy committed Oct 14, 2021
    Configuration menu
    Copy the full SHA
    929b8f3 View commit details
    Browse the repository at this point in the history
  2. wip refactor alignment

    Almost done rewriting `align`.
    benbovy committed Oct 14, 2021
    Configuration menu
    Copy the full SHA
    02cc5d2 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2021

  1. tweaks and fixes

    - Some fixes and clean-up in new implementation of align
    - Add Index.join method (only for inner/outer join)
    - Tweak index generic types
    - IndexVars type: use Variable instead of IndexVariable (IndexVariable
      may eventually be dropped)
    benbovy committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    d1bbc4a View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2021

  1. wip refactor alignment and reindex

    Imported all re-indexing logic into the `Alignator` class, which can be
    reused directly for both `align()` and `obj.reindex()`.
    
    TODO:
    - import override indexes into `Alignator`
    - connect Alignator to public API entry points
    - clean-up (remove old implementation functions)
    benbovy committed Oct 18, 2021
    Configuration menu
    Copy the full SHA
    0624204 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2021

  1. Configuration menu
    Copy the full SHA
    30fee83 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    981fa0d View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2021

  1. wip alignment: clean-up + tests

    I will fix mypy errors later.
    benbovy committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    79b5223 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2021

  1. refactor alignment fix tests & types annotations

    All `*align*` and `*reindex*` tests are passing! (locally)
    Mypy doesn't complain.
    
    TODO: refactor `interp` and `interp_like` (I only plan to fix it with
    the new Aligner class for now)
    benbovy committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    63a4291 View commit details
    Browse the repository at this point in the history
  2. refactor interp and interp_like

    It now reuses the new alignment/reindex internals, but it still only
    supports dimension coordinates with a single index,
    benbovy committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    9f8d26d View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2021

  1. wip review merge

    benbovy committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    f291c65 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2021

  1. refactor swap_dims

    benbovy committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    8e3eef2 View commit details
    Browse the repository at this point in the history
  2. refactor isel

    benbovy committed Oct 25, 2021
    Configuration menu
    Copy the full SHA
    5e5abb7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2c11dbc View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2021

  1. add Index.stack and Index.unstack methods

    Also added a `index_cls` parameter to `Dataset.stack` and
    `DataArray.stack`.
    
    Custom indexes may thus implement their own logic for stack/unstack,
    with the current limitation that a `pandas.MultiIndex` is still
    explicitly required for unstack optimized versions.
    benbovy committed Oct 27, 2021
    Configuration menu
    Copy the full SHA
    e65e3f3 View commit details
    Browse the repository at this point in the history
  2. fix PandasIndex.isel with scalar indexers

    Fix concat tests and some groupby tests
    benbovy committed Oct 27, 2021
    Configuration menu
    Copy the full SHA
    d02dc17 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    557e8b1 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2021

  1. more indexes invariants checks

    Check consistency between PandasIndex objects and
    coordinate variables data adapters (PandasIndexingAdapter).
    benbovy committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    15f6b17 View commit details
    Browse the repository at this point in the history
  2. fix DataArray.isel()

    benbovy committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    29035aa View commit details
    Browse the repository at this point in the history
  3. refactor Dataset/DataArray copy

    Filter indexes and preserve unique index objects for multi-coordinate
    indexes.
    
    Also fixed indexes tests (stack/unstack).
    benbovy committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    2a067bd View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c8e7a06 View commit details
    Browse the repository at this point in the history
  5. minor fixes and tweaks

    benbovy committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    9963520 View commit details
    Browse the repository at this point in the history
  6. propagate_indexes -> filter_indexes_from_coords

    We can't just look at excluded dimensions anymore...
    benbovy committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    e0f498a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7901404 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2021

  1. Configuration menu
    Copy the full SHA
    26bc7c9 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2021

  1. refactor expand_dims

    benbovy committed Nov 2, 2021
    Configuration menu
    Copy the full SHA
    5da11f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0b08c1 View commit details
    Browse the repository at this point in the history
  3. wip refactor update coords

    Check in merge that prioritized elements won't corrupt collected
    indexes.
    benbovy committed Nov 2, 2021
    Configuration menu
    Copy the full SHA
    fbf556c View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2021

  1. refactor update/remove coords

    Fixes and tweaks
    Refactored assign, update, setitem, delitem, drop_vars
    Added or updated tests
    benbovy committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    ef3feb6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    52da324 View commit details
    Browse the repository at this point in the history
  3. misc. fixes

    benbovy committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    78f4fb0 View commit details
    Browse the repository at this point in the history
  4. fix Dataset,__delitem__

    benbovy committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    4dcb136 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    72aff10 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2021

  1. Configuration menu
    Copy the full SHA
    c0eb3dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    34749b2 View commit details
    Browse the repository at this point in the history
  3. PandasIndex.from_variables: preserve wrapped index

    Prevent converting special index types like ``pd.CategoricalIndex`` when
    such objects are wrapped in xarray variables.
    benbovy committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    ef952b2 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2022

  1. Configuration menu
    Copy the full SHA
    adcec91 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1d6694a View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2022

  1. Configuration menu
    Copy the full SHA
    ebb2605 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2022

  1. Configuration menu
    Copy the full SHA
    5c3ff55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8e8690a View commit details
    Browse the repository at this point in the history
  3. groupby combine: fix missing index in result

    When coord is None
    benbovy committed Feb 4, 2022
    Configuration menu
    Copy the full SHA
    93c3f69 View commit details
    Browse the repository at this point in the history
  4. implicit multi-index coord: more robust fix

    Also cover the cases where indexes are equal but not identical (caused a
    couple of tests failing). Perfs may not be a concern for such edge case?
    benbovy committed Feb 4, 2022
    Configuration menu
    Copy the full SHA
    3316ee4 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2022

  1. Configuration menu
    Copy the full SHA
    f9a0424 View commit details
    Browse the repository at this point in the history
  2. backward compat fix: multi-index given as data-var

    ... in Dataset constructor
    benbovy committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    f2b25f5 View commit details
    Browse the repository at this point in the history
  3. refactor concat

    Summary:
    
    - Add the ``Index.concat()`` class method with implementations for
      ``PandasIndex`` and ``PandasMultiIndex`` (adapted from
      ``IndexVariable.concat()``).
    
    - Use ``Index.concat()`` to create new indexes (and their corresponding
      variables) in ``_dataset_concat``. Fallback to variable concatenation
      (with default index) when no implementation is given for
      ``Index.concat`` or when no all the variables have an index.
    
    - Refactored merging the other variables (also merge the indexes) in
      ``_dataset_concat``.
    
    This refactor is incomplete. It should work with Pandas (multi-)indexes
    but it is likely that it won't work with meta-indexes involving multiple
    dimensions. We probably need to update ``_calc_concat_over`` to take
    into account such meta-indexes and their related coordinates.
    
    Other limitation (?) we use here the index of the 1st dataset for the
    concatenation (i.e., ``Index.concat``). No specific check is made on
    the type and/or coordinates of the other indexes.
    benbovy committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    627a001 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2022

  1. Configuration menu
    Copy the full SHA
    ba1c75f View commit details
    Browse the repository at this point in the history
  2. PandasIndex.from_variables(multi-index level var)

    Make sure it gets the level index (not the whole multi-index).
    benbovy committed Feb 10, 2022
    Configuration menu
    Copy the full SHA
    3371623 View commit details
    Browse the repository at this point in the history
  3. reindex: disable invalid dimension check

    From the docstrings: mis-matched dimensions are simply ignored
    benbovy committed Feb 10, 2022
    Configuration menu
    Copy the full SHA
    8fec03c View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2022

  1. Configuration menu
    Copy the full SHA
    d76be3d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b78f4b View commit details
    Browse the repository at this point in the history
  3. refactor pad

    benbovy committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    7ce000e View commit details
    Browse the repository at this point in the history
  4. unstack: return copies of mindex.levels

    Fix error when trying to set the name of the extracted level indexes.
    benbovy committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    5fa287f View commit details
    Browse the repository at this point in the history
  5. strip_units: prevent index->array conversion

    which caused alignment conflicts due to multi-index
    variable converted to non-index variable.
    benbovy committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    11bf070 View commit details
    Browse the repository at this point in the history
  6. attach_units: do not preserve coord multi-indexes

    To prevent conflicts when trying to implicitly create
    multi-index coordinates.
    benbovy committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    35a7464 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2022

  1. Configuration menu
    Copy the full SHA
    cfb0cf1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8cc1253 View commit details
    Browse the repository at this point in the history
  3. Dataset.copy: don't reset indexes if data is given

    The `data` parameter accepts new data for data variables only, it won't
    affect the indexes.
    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    ead47a2 View commit details
    Browse the repository at this point in the history
  4. reindex/align: fix coord dtype of new indexes

    Use `as_compatible_data` to get the right dtype to assign to the new
    index coordinates created from reindex indexers.
    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    23dc4cf View commit details
    Browse the repository at this point in the history
  5. fix doctests

    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    8b325ef View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8528377 View commit details
    Browse the repository at this point in the history
  7. to_stacked_array: do not coerce level dtypes

    If the intent was to propagate the original coordinate dtypes, this is
    now handled by PandasMultiIndex.stack.
    
    This fixes the case where multi-index ``.levels`` do not return labels
    with "nan" values (if any) but where the coordinate does, which resulted
    in dtype mismatch between the coordinate variable dtype (e.g., coerced
    to int64) and the actual label values (float64 due to nan values),
    eventually causing numpy errors trying to coerce nan value to int64 when
    indexing the coordinate.
    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    30023a4 View commit details
    Browse the repository at this point in the history
  8. fix indent

    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    d7fed29 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    76e15ef View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d69bb45 View commit details
    Browse the repository at this point in the history
  11. unstack full-reindex: fix alignment errors

    We need a mapping of all index coordinate names to the full index
    so that Aligner can find matching indexes.
    
    (Note: reindex may eventually be refactored to be a bit more clever so
    that providing only a `{dim: indexer}` will be enough in this case?)
    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    44e6893 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    50bd989 View commit details
    Browse the repository at this point in the history
  13. refactor diff

    benbovy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    1184f50 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ed7f24b View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ffa06da View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2022

  1. refactor roll

    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    7c08769 View commit details
    Browse the repository at this point in the history
  2. rename Index.query -> Index.sel

    Also rename:
    - QueryResult -> IndexSelResult
    - merge_query_results -> merge_sel_results
    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    71ac97a View commit details
    Browse the repository at this point in the history
  3. remove Index.union and Index.intersection

    Those are not used elsewhere.
    ``Index.join`` is used instead for alignment.
    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    7600e46 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1b6c97d View commit details
    Browse the repository at this point in the history
  5. Index.rename: return only the new index

    Create new coordinate variables using Index.create_variables
    instead (get rid of PandasIndex.from_pandas_index).
    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    eda0e85 View commit details
    Browse the repository at this point in the history
  6. Index.stack: return only the new index

    Create new coordinate variables using Index.create_variables
    instead (get rid of PandasIndex.from_pandas_index)
    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    24d7719 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2aea2e3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    32d887c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    851a942 View commit details
    Browse the repository at this point in the history
  10. Index.from_variables: return the new index only

    Use Index.create_variables to get the new coordinate variables.
    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    3134f33 View commit details
    Browse the repository at this point in the history
  11. rename: propagate_attrs_encoding not needed

    Index.create_variables already propagates coordinate variable metadata.
    benbovy committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    9bbf659 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2022

  1. Configuration menu
    Copy the full SHA
    af34834 View commit details
    Browse the repository at this point in the history
  2. fix set_index append=True

    Level variables may have updated names in this case: single index + one
    level.
    benbovy committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    fe4fcc5 View commit details
    Browse the repository at this point in the history
  3. refactor default_indexes and re-enable invariant check

    Default indexes invariant check is now optional (enabled by default).
    benbovy committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    df31fa8 View commit details
    Browse the repository at this point in the history
  4. fix formatting errors

    benbovy committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    631a8e2 View commit details
    Browse the repository at this point in the history
  5. fix type

    benbovy committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    21fa7a8 View commit details
    Browse the repository at this point in the history
  6. Dataset._indexes, DataArray._indexes: always dict

    Default indexes are created by the default constructors. Indexes are
    always passed explicitly by the fastpath constructors.
    benbovy committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    f573085 View commit details
    Browse the repository at this point in the history
  7. remove _level_coords property

    It was only used for plotting and has been replaced by simpler logic.
    benbovy committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    3280eeb View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

  1. clean-up

    Use ``_indexes`` instead of ``.xindexes`` when possible, for speed.
    ``xindexes`` is not cached: it would return inconsistent results if
    updating the object in-place.
    
    Fix some types.
    benbovy committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    a415188 View commit details
    Browse the repository at this point in the history
  2. optimize Dataset/DataArray copy

    Avoid copying pandas indexes twice (indexes + coordinate variables)
    benbovy committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    6405ffd View commit details
    Browse the repository at this point in the history
  3. add default implementation for Index.copy

    Better than raising an error?
    benbovy committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    2b1f90b View commit details
    Browse the repository at this point in the history
  4. add/fix indexes tests

    benbovy committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    73ba9d4 View commit details
    Browse the repository at this point in the history
  5. tweak indexes formatting

    This will need more work (in a follow-up PR) to be consistent with the
    other data model components (i.e., coordinates and data variables): add
    summary (inline) and detailed reprs, maybe group by coordinates, etc.
    benbovy committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    3927479 View commit details
    Browse the repository at this point in the history
  6. fix doctests

    benbovy committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    a3173b5 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2022

  1. Configuration menu
    Copy the full SHA
    709a58e View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2022

  1. DataArray stack test: revert to original

    Now that default (range) indexes are created again (create_index=True).
    benbovy committed Feb 21, 2022
    Configuration menu
    Copy the full SHA
    ed1af4d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9708eb3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f57db5 View commit details
    Browse the repository at this point in the history
  4. misc. tweaks

    benbovy committed Feb 21, 2022
    Configuration menu
    Copy the full SHA
    df64f0d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a9add15 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2022

  1. Aligner tweaks

    Access aligned objects through the ``.result`` attribute.
    
    Enable type checking in internal methods.
    benbovy committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    f807733 View commit details
    Browse the repository at this point in the history
  2. remove assert_unique_multiindex_level_names

    It is not needed anymore as multi-indexes have their own coordinates and
    we now check for possible name conflicts when "unpacking" multi-index
    levels at Dataset / DataArray creation.
    benbovy committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    e97653e View commit details
    Browse the repository at this point in the history
  3. remove propagate_attrs_encoding

    Only used in one place.
    benbovy committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    72d0782 View commit details
    Browse the repository at this point in the history
  4. assert -> check + ValueError

    benbovy committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    4f24faf View commit details
    Browse the repository at this point in the history
  5. misc. fixes and tweaks

    benbovy committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    601dc3a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5bf582b View commit details
    Browse the repository at this point in the history
  7. update what's new

    benbovy committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    bf0dbb7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1baa875 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2022

  1. concat: remove fall-backs to Variable.concat

    Raise an error instead when trying to concat a mix of indexed and
    un-indexed coordinates or when the index doesn't support concat.
    
    We still support the concatenation of a mix of scalar and dimension
    indexed coordinates by creating a PandasIndex on-the-fly for scalar
    coordinates.
    benbovy committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    c1b778a View commit details
    Browse the repository at this point in the history
  2. fix flaky test

    benbovy committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    77fdaf0 View commit details
    Browse the repository at this point in the history