generated from carbonplan/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb6e960
commit d10a18e
Showing
6 changed files
with
36 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
from __future__ import annotations # noqa: F401 | ||
|
||
import importlib | ||
from ._version import __version__ | ||
|
||
|
||
def get_version(): | ||
try: | ||
return importlib.import_module('ndpyramid').__version__ | ||
except ModuleNotFoundError: | ||
return '-9999' | ||
def get_version() -> str: | ||
return __version__ | ||
|
||
|
||
def multiscales_template(datasets=[], type='', method='', version='', args=[], kwargs={}): | ||
def multiscales_template( | ||
datasets: list = None, | ||
type: str = '', | ||
method: str = '', | ||
version: str = '', | ||
args: list = None, | ||
kwargs: dict = None, | ||
): | ||
if datasets is None: | ||
datasets = [] | ||
if args is None: | ||
args = [] | ||
if kwargs is None: | ||
kwargs = {} | ||
# https://forum.image.sc/t/multiscale-arrays-v0-1/37930 | ||
d = [ | ||
return [ | ||
{ | ||
'datasets': datasets, | ||
'type': type, | ||
'metadata': {'method': method, 'version': version, 'args': args, 'kwargs': kwargs}, | ||
} | ||
] | ||
return d |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
numpy | ||
xarray | ||
xarray-datatree >= 0.0.3 | ||
xarray-datatree >= 0.0.4 | ||
zarr |
This file contains 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