Skip to content

Commit

Permalink
move to src layout
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiesquire committed Mar 29, 2023
1 parent 0abdac1 commit 253e496
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/catalog_manager/_version.py export-subst
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versioneer]
VCS = git
style = pep440
versionfile_source = catalog_manager/_version.py
versionfile_source = src/catalog_manager/_version.py
versionfile_build = catalog_manager/_version.py
tag_prefix = v
parentdir_prefix = catalog_manager-
parentdir_prefix =

[flake8]
exclude = __init__.py
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
url="https://github.com/ACCESS-NRI/intake_catalog",
description="Tools and configuration info for managing ACCESS-NRI's intake catalogue",
packages=find_packages(),
package_dir={"": "src"},
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
from . import _version

__version__ = _version.get_versions()["version"]

from . import _version

__version__ = _version.get_versions()["version"]
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = "v"
cfg.parentdir_prefix = "catalog_manager-"
cfg.versionfile_source = "catalog_manager/_version.py"
cfg.parentdir_prefix = ""
cfg.versionfile_source = "src/catalog_manager/_version.py"
cfg.verbose = False
return cfg

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions catalog_manager/esm/base.py → src/catalog_manager/esm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
lambda x: any(
re.match(pattern, x)
for pattern in [
r"\d+_yearly",
r"\d+_monthly",
r"\d+_daily",
r"\d+_hourly",
"static",
r"\d+yr",
r"\d+mon",
r"\d+day",
r"\d+hr",
"fx",
]
),
"must be one of 'Nyr', 'Nmon', 'Nday', 'Nhr', 'fx', where N is an integer",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def get_timeinfo(ds, time_dim="time"):
time_dim: str
The name of the time dimension
"""
# TODO: This function needs work

if time_dim is None:
return None
Expand All @@ -45,6 +44,7 @@ def _todate(t):
next_time = _todate(time_var[1])

dt = next_time - start_time
# TODO: This is not a very good way to get the frequency
if dt.days >= 365:
years = round(dt.days / 365)
frequency = f"{years}yr"
Expand Down

0 comments on commit 253e496

Please sign in to comment.