Skip to content

Commit 0b4896c

Browse files
committed
Include optimization parameter basis (#79)
* Make Column generic enough for multiple parents * Introduce optimization.Parameter * Add tests for add_data * Enable remaining parameter tests (#86) * Enable remaining parameter tests * Include optimization parameter api layer (#89) * Bump several dependency versions * Let api/column handle both tables and parameters * Make api-layer tests pass * Include optimization parameter core layer (#90) * Enable parameter core layer and test it * Fix things after rebase * Ensure all intended changes survive the rebase * Adapt data validation function for parameters * Allow tests to pass again
1 parent 85c0bc2 commit 0b4896c

File tree

6 files changed

+3
-22
lines changed

6 files changed

+3
-22
lines changed

ixmp4/data/db/optimization/base.py

-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
Deleter,
1313
Enumerator,
1414
Lister,
15-
OptimizationDataMixin,
16-
OptimizationNameMixin,
1715
Retriever,
18-
RunIDMixin,
1916
Selecter,
2017
Tabulator,
2118
)

ixmp4/data/db/optimization/indexset/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .. import base
1111

1212

13-
class IndexSet(base.BaseModel, base.UniqueNameRunIDMixin):
13+
class IndexSet(base.BaseModel):
1414
NotFound: ClassVar = abstract.IndexSet.NotFound
1515
NotUnique: ClassVar = abstract.IndexSet.NotUnique
1616
DataInvalid: ClassVar = OptimizationDataValidationError

ixmp4/data/db/optimization/scalar/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .. import base
99

1010

11-
class Scalar(base.BaseModel, base.UniqueNameRunIDMixin):
11+
class Scalar(base.BaseModel):
1212
NotFound: ClassVar = abstract.Scalar.NotFound
1313
NotUnique: ClassVar = abstract.Scalar.NotUnique
1414
DeletionPrevented: ClassVar = abstract.Scalar.DeletionPrevented

ixmp4/data/db/optimization/table/model.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
from .. import Column, base, utils
1212

1313

14-
class Table(
15-
base.BaseModel,
16-
base.OptimizationDataMixin,
17-
base.UniqueNameRunIDMixin,
18-
):
14+
class Table(base.BaseModel):
1915
# NOTE: These might be mixin-able, but would require some abstraction
2016
NotFound: ClassVar = abstract.Table.NotFound
2117
NotUnique: ClassVar = abstract.Table.NotUnique

tests/core/test_optimization_table.py

-6
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ def df_from_list(tables: list[Table]):
2121
table.data,
2222
table.name,
2323
table.id,
24-
table.data,
25-
table.name,
2624
table.created_at,
2725
table.created_by,
28-
table.run_id,
2926
]
3027
for table in tables
3128
],
@@ -34,11 +31,8 @@ def df_from_list(tables: list[Table]):
3431
"data",
3532
"name",
3633
"id",
37-
"data",
38-
"name",
3934
"created_at",
4035
"created_by",
41-
"run__id",
4236
],
4337
)
4438

tests/data/test_optimization_table.py

-6
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ def df_from_list(tables: list):
1919
table.data,
2020
table.name,
2121
table.id,
22-
table.data,
23-
table.name,
2422
table.created_at,
2523
table.created_by,
26-
table.run__id,
2724
]
2825
for table in tables
2926
],
@@ -32,11 +29,8 @@ def df_from_list(tables: list):
3229
"data",
3330
"name",
3431
"id",
35-
"data",
36-
"name",
3732
"created_at",
3833
"created_by",
39-
"run__id",
4034
],
4135
)
4236

0 commit comments

Comments
 (0)