climate-ref 0.6.3__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. {climate_ref-0.6.3 → climate_ref-0.6.4}/PKG-INFO +1 -1
  2. {climate_ref-0.6.3 → climate_ref-0.6.4}/pyproject.toml +1 -1
  3. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/config.py +8 -6
  4. climate_ref-0.6.4/src/climate_ref/migrations/versions/2025-07-03T1505_795c1e6cf496_drop_unique_requirement_on_slug.py +34 -0
  5. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/diagnostic.py +1 -1
  6. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/test_config.py +15 -12
  7. {climate_ref-0.6.3 → climate_ref-0.6.4}/.gitignore +0 -0
  8. {climate_ref-0.6.3 → climate_ref-0.6.4}/Dockerfile +0 -0
  9. {climate_ref-0.6.3 → climate_ref-0.6.4}/LICENCE +0 -0
  10. {climate_ref-0.6.3 → climate_ref-0.6.4}/NOTICE +0 -0
  11. {climate_ref-0.6.3 → climate_ref-0.6.4}/README.md +0 -0
  12. {climate_ref-0.6.3 → climate_ref-0.6.4}/conftest.py +0 -0
  13. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/__init__.py +0 -0
  14. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/_config_helpers.py +0 -0
  15. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/alembic.ini +0 -0
  16. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/__init__.py +0 -0
  17. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/_utils.py +0 -0
  18. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/config.py +0 -0
  19. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/datasets.py +0 -0
  20. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/executions.py +0 -0
  21. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/providers.py +0 -0
  22. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/cli/solve.py +0 -0
  23. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/constants.py +0 -0
  24. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/database.py +0 -0
  25. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/dataset_registry/obs4ref_reference.txt +0 -0
  26. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/dataset_registry/sample_data.txt +0 -0
  27. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/datasets/__init__.py +0 -0
  28. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/datasets/base.py +0 -0
  29. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/datasets/cmip6.py +0 -0
  30. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/datasets/obs4mips.py +0 -0
  31. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/datasets/pmp_climatology.py +0 -0
  32. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/datasets/utils.py +0 -0
  33. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/executor/__init__.py +0 -0
  34. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/executor/hpc.py +0 -0
  35. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/executor/local.py +0 -0
  36. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/executor/result_handling.py +0 -0
  37. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/executor/synchronous.py +0 -0
  38. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/migrations/README +0 -0
  39. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/migrations/env.py +0 -0
  40. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/migrations/script.py.mako +0 -0
  41. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/migrations/versions/2025-05-02T1418_341a4aa2551e_regenerate.py +0 -0
  42. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/migrations/versions/2025-05-09T2032_03dbb4998e49_series_metric_value.py +0 -0
  43. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/__init__.py +0 -0
  44. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/base.py +0 -0
  45. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/dataset.py +0 -0
  46. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/execution.py +0 -0
  47. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/metric_value.py +0 -0
  48. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/models/provider.py +0 -0
  49. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/provider_registry.py +0 -0
  50. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/py.typed +0 -0
  51. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/slurm.py +0 -0
  52. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/solver.py +0 -0
  53. {climate_ref-0.6.3 → climate_ref-0.6.4}/src/climate_ref/testing.py +0 -0
  54. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_config.py +0 -0
  55. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_datasets.py +0 -0
  56. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_executions/test_inspect.txt +0 -0
  57. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_executions.py +0 -0
  58. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_providers.py +0 -0
  59. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_root.py +0 -0
  60. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/cli/test_solve.py +0 -0
  61. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/conftest.py +0 -0
  62. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_cmip6/cmip6_catalog_db.yml +0 -0
  63. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_cmip6/cmip6_catalog_local.yml +0 -0
  64. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_cmip6.py +0 -0
  65. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_datasets.py +0 -0
  66. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_obs4mips/obs4mips_catalog_db.yml +0 -0
  67. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_obs4mips/obs4mips_catalog_local.yml +0 -0
  68. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_obs4mips.py +0 -0
  69. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_pmp_climatology/pmp_catalog_local.yml +0 -0
  70. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_pmp_climatology.py +0 -0
  71. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/datasets/test_utils.py +0 -0
  72. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/executor/test_hpc_executor.py +0 -0
  73. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/executor/test_local_executor.py +0 -0
  74. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/executor/test_result_handling.py +0 -0
  75. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/executor/test_synchronous_executor.py +0 -0
  76. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/models/test_metric_execution.py +0 -0
  77. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/models/test_metric_value.py +0 -0
  78. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/test_database.py +0 -0
  79. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/test_provider_registry.py +0 -0
  80. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/test_slurm.py +0 -0
  81. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/test_solver/test_solve_metrics.yml +0 -0
  82. {climate_ref-0.6.3 → climate_ref-0.6.4}/tests/unit/test_solver.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: climate-ref
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: Application which runs the CMIP Rapid Evaluation Framework
5
5
  Author-email: Jared Lewis <jared.lewis@climate-resource.com>, Mika Pflueger <mika.pflueger@climate-resource.com>, Bouwe Andela <b.andela@esciencecenter.nl>, Jiwoo Lee <lee1043@llnl.gov>, Min Xu <xum1@ornl.gov>, Nathan Collier <collierno@ornl.gov>, Dora Hegedus <dora.hegedus@stfc.ac.uk>
6
6
  License-Expression: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "climate-ref"
3
- version = "0.6.3"
3
+ version = "0.6.4"
4
4
  description = "Application which runs the CMIP Rapid Evaluation Framework"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -215,17 +215,17 @@ class DiagnosticProviderConfig:
215
215
 
216
216
  ```toml
217
217
  [[diagnostic_providers]]
218
- provider = "climate_ref_esmvaltool.provider"
218
+ provider = "climate_ref_esmvaltool:provider"
219
219
 
220
220
  [diagnostic_providers.config]
221
221
 
222
222
  [[diagnostic_providers]]
223
- provider = "climate_ref_ilamb.provider"
223
+ provider = "climate_ref_ilamb:provider"
224
224
 
225
225
  [diagnostic_providers.config]
226
226
 
227
227
  [[diagnostic_providers]]
228
- provider = "climate_ref_pmp.provider"
228
+ provider = "climate_ref_pmp:provider"
229
229
 
230
230
  [diagnostic_providers.config]
231
231
  ```
@@ -311,10 +311,12 @@ def default_providers() -> list[DiagnosticProviderConfig]:
311
311
  if env_providers:
312
312
  return [DiagnosticProviderConfig(provider=provider) for provider in env_providers]
313
313
 
314
+ # Refer to https://setuptools.pypa.io/en/latest/userguide/entry_point.html#entry-points-for-plugins
315
+ # and https://packaging.python.org/en/latest/specifications/entry-points/
316
+ # to learn more about entry points.
314
317
  return [
315
- DiagnosticProviderConfig(provider="climate_ref_esmvaltool.provider", config={}),
316
- DiagnosticProviderConfig(provider="climate_ref_ilamb.provider", config={}),
317
- DiagnosticProviderConfig(provider="climate_ref_pmp.provider", config={}),
318
+ DiagnosticProviderConfig(provider=entry_point.value, config={})
319
+ for entry_point in importlib.metadata.entry_points(group="climate-ref.providers")
318
320
  ]
319
321
 
320
322
 
@@ -0,0 +1,34 @@
1
+ """Drop unique requirement on slug
2
+
3
+ Revision ID: 795c1e6cf496
4
+ Revises: 03dbb4998e49
5
+ Create Date: 2025-07-03 15:05:28.517124
6
+
7
+ """
8
+
9
+ from collections.abc import Sequence
10
+ from typing import Union
11
+
12
+ from alembic import op
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = "795c1e6cf496"
16
+ down_revision: Union[str, None] = "03dbb4998e49"
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ # ### commands auto generated by Alembic - please adjust! ###
23
+ with op.batch_alter_table("diagnostic", schema=None) as batch_op:
24
+ batch_op.drop_constraint("uq_diagnostic_slug", type_="unique")
25
+
26
+ # ### end Alembic commands ###
27
+
28
+
29
+ def downgrade() -> None:
30
+ # ### commands auto generated by Alembic - please adjust! ###
31
+ with op.batch_alter_table("diagnostic", schema=None) as batch_op:
32
+ batch_op.create_unique_constraint("uq_diagnostic_slug", ["slug"])
33
+
34
+ # ### end Alembic commands ###
@@ -19,7 +19,7 @@ class Diagnostic(CreatedUpdatedMixin, Base):
19
19
  __table_args__ = (UniqueConstraint("provider_id", "slug", name="diagnostic_ident"),)
20
20
 
21
21
  id: Mapped[int] = mapped_column(primary_key=True)
22
- slug: Mapped[str] = mapped_column(unique=True)
22
+ slug: Mapped[str] = mapped_column()
23
23
  """
24
24
  Unique identifier for the diagnostic
25
25
 
@@ -1,3 +1,4 @@
1
+ import importlib.metadata
1
2
  import logging
2
3
  import sys
3
4
  from pathlib import Path
@@ -119,6 +120,18 @@ filename = "sqlite://climate_ref.db"
119
120
  def test_defaults(self, monkeypatch, mocker):
120
121
  monkeypatch.setenv("REF_CONFIGURATION", "test")
121
122
  mocker.patch("climate_ref.config.importlib.resources.files", return_value=Path("pycmec"))
123
+ mocker.patch(
124
+ "climate_ref.config.importlib.metadata.entry_points",
125
+ return_value=importlib.metadata.EntryPoints(
126
+ [
127
+ importlib.metadata.EntryPoint(
128
+ name="example",
129
+ value="climate_ref_example:provider",
130
+ group="climate-ref.providers",
131
+ ),
132
+ ]
133
+ ),
134
+ )
122
135
 
123
136
  cfg = Config.load(Path("test.toml"))
124
137
  default_path = Path("test").resolve()
@@ -131,9 +144,7 @@ filename = "sqlite://climate_ref.db"
131
144
  "log_level": "INFO",
132
145
  "log_format": DEFAULT_LOG_FORMAT,
133
146
  "diagnostic_providers": [
134
- {"provider": "climate_ref_esmvaltool.provider"},
135
- {"provider": "climate_ref_ilamb.provider"},
136
- {"provider": "climate_ref_pmp.provider"},
147
+ {"provider": "climate_ref_example:provider"},
137
148
  ],
138
149
  }
139
150
  assert with_defaults == {
@@ -141,15 +152,7 @@ filename = "sqlite://climate_ref.db"
141
152
  "log_format": DEFAULT_LOG_FORMAT,
142
153
  "diagnostic_providers": [
143
154
  {
144
- "provider": "climate_ref_esmvaltool.provider",
145
- "config": {},
146
- },
147
- {
148
- "provider": "climate_ref_ilamb.provider",
149
- "config": {},
150
- },
151
- {
152
- "provider": "climate_ref_pmp.provider",
155
+ "provider": "climate_ref_example:provider",
153
156
  "config": {},
154
157
  },
155
158
  ],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes