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

missing integration stuff #73

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/73.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added overlooked code to fully integrate ilamb into ref.
1 change: 1 addition & 0 deletions docs/gen_doc_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def write_module_page(
write_module_page("cmip_ref_core")
write_module_page("cmip_ref_metrics_example")
write_module_page("cmip_ref_metrics_esmvaltool")
write_module_page("cmip_ref_metrics_ilamb")

with mkdocs_gen_files.open(ROOT_DIR / "NAVIGATION.md", "w") as fh:
fh.writelines(nav.build_literate_nav())
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class GlobalMeanTimeseries(Metric):
Calculate the global mean timeseries for a dataset
"""

name = "Global Mean Timeseries"
slug = "global-mean-timeseries"
name = "ILAMB Global Mean Timeseries"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the slug had to be globally unique. The intention was that it is unique for a provider. The constraint is that the combination of the provider slug + the metric slug was unique

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a bunch (~10) failed tests due to some errors which reported 'unique slug' problems that were fixed when I made the change. But I will check this again.

slug = "ilamb-global-mean-timeseries"

data_requirements = (
DataRequirement(
Expand Down
4 changes: 3 additions & 1 deletion packages/ref/src/cmip_ref/provider_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ def build_from_db(db: Database) -> "ProviderRegistry":
# TODO: We don't yet have any tables to represent metrics providers
from cmip_ref_metrics_esmvaltool import provider as esmvaltool_provider
from cmip_ref_metrics_example import provider as example_provider
from cmip_ref_metrics_ilamb import provider as ilamb_provider

with db.session.begin_nested():
_register_provider(db, example_provider)
_register_provider(db, esmvaltool_provider)
return ProviderRegistry(providers=[example_provider, esmvaltool_provider])
_register_provider(db, ilamb_provider)
return ProviderRegistry(providers=[example_provider, esmvaltool_provider, ilamb_provider])
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies = [
"cmip_ref_core",
"cmip_ref_metrics_example",
"cmip_ref_metrics_esmvaltool",
"cmip_ref_metrics_ilamb",
]

[project.license]
Expand Down Expand Up @@ -62,6 +63,7 @@ cmip_ref = { workspace = true }
cmip_ref_core = { workspace = true }
cmip_ref_metrics_example = { workspace = true }
cmip_ref_metrics_esmvaltool = { workspace = true }
cmip_ref_metrics_ilamb = { workspace = true }

[tool.coverage.run]
source = ["packages"]
Expand Down
2 changes: 2 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading