Skip to content

Commit

Permalink
Merge pull request #57 from roocs/release-0.2.0
Browse files Browse the repository at this point in the history
Changes to HISTORY etc. for release 0.2.0
  • Loading branch information
ellesmith88 authored Feb 18, 2021
2 parents 8e99077 + d28115f commit 2894c6b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
26 changes: 26 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
Version History
===============

v0.2.0 (2021-02-18)
-------------------

Breaking Changes
^^^^^^^^^^^^^^^^
* cf_xarray>=0.3.1 now required due to differing level identification of coordinates between versions.
* oyaml>=0.9 - new dependency for inventory
* Interface to inventory maker changed. Detailed instructions for use added in README.
* Adjusted file name template. Underscore removed before ``__derive__time_range``
* New dev dependency: GitPython==3.1.12

New Features
^^^^^^^^^^^^
* Added ``use_inventory`` option to ``roocs.ini`` config and allow data to be used without checking an inventory.
* ``DatasetMapper`` class and wrapper functions added to ``roocs_utils.project_utils`` and ``roocs_utils.xarray_utils.xarray_utils`` to resolve all paths and dataset ids in the same way.
* ``FileMapper`` added in ``roocs_utils.utils.file_utils`` to resolve resolve multiple files with the same directory to their directory path.
* Fixed path mapping support added in ``DatasetMapper``
* Added ``DimensionParameter`` to be used with the average operation.

Other Changes
^^^^^^^^^^^^^
* Removed submodule for test data. Test data is now cloned from git using GitPython and cached
* ``CollectionParamter`` accepts an instance of ``FileMapper`` or a sequence of ``FileMapper`` objects
* Adjusted file name template to include an ``extra`` option before the file extension.
* Swapped from travis CI to GitHub actions

v0.1.5 (2020-11-23)
-------------------

Expand Down
22 changes: 22 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,29 @@ Parameters
:undoc-members:
:show-inheritance:

.. automodule:: roocs_utils.parameter.dimension_parameter
:noindex:
:members:
:undoc-members:
:show-inheritance:

.. automodule:: roocs_utils.parameter.parameterise
:noindex:
:members:
:undoc-members:
:show-inheritance:


Project Utils
=============

.. automodule:: roocs_utils.project_utils
:noindex:
:members:
:undoc-members:
:show-inheritance:


Xarray Utils
============

Expand All @@ -66,3 +82,9 @@ Other utilities
:members:
:undoc-members:
:show-inheritance:

.. automodule:: roocs_utils.utils.file_utils
:noindex:
:members:
:undoc-members:
:show-inheritance:
6 changes: 4 additions & 2 deletions roocs_utils/inventory/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@


def get_time_info(fpaths, var_id):

all_times = []
for fpath in sorted(fpaths):

try:

ds = xr.open_dataset(fpath, use_cftime=True)
times = ds[var_id].time.values

Expand Down Expand Up @@ -94,9 +94,11 @@ def get_var_metadata(fpaths, var_id):


def build_dict(ds_id, proj_dict):

fpaths = DatasetMapper(ds_id).files

if len(fpaths) < 1:
raise FileNotFoundError("No files were found for this dataset")

comps = ds_id.split(".")

facet_rule = proj_dict["facet_rule"]
Expand Down
1 change: 0 additions & 1 deletion roocs_utils/project_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def get_project_from_ds(ds):


def get_project_name(dset):

if type(dset) in (xr.core.dataarray.DataArray, xr.core.dataset.Dataset):
return get_project_from_ds(dset) # will not return c3s dataset

Expand Down
1 change: 1 addition & 0 deletions roocs_utils/xarray_utils/xarray_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def get_coord_by_type(ds, coord_type, ignore_aux_coords=True):
:return: Xarray Dataset coordinate (ds.coords[coord_id])
"""
"Can take a Dataset or DataArray"

if coord_type not in known_coord_types:
raise Exception(f"Coordinate type not known: {coord_type}")

Expand Down

0 comments on commit 2894c6b

Please sign in to comment.