Skip to content

Commit

Permalink
Include optimization parameter basis (#79)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
glatterf42 committed Oct 1, 2024
1 parent 85c0bc2 commit 0b4896c
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 22 deletions.
3 changes: 0 additions & 3 deletions ixmp4/data/db/optimization/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
Deleter,
Enumerator,
Lister,
OptimizationDataMixin,
OptimizationNameMixin,
Retriever,
RunIDMixin,
Selecter,
Tabulator,
)
Expand Down
2 changes: 1 addition & 1 deletion ixmp4/data/db/optimization/indexset/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .. import base


class IndexSet(base.BaseModel, base.UniqueNameRunIDMixin):
class IndexSet(base.BaseModel):
NotFound: ClassVar = abstract.IndexSet.NotFound
NotUnique: ClassVar = abstract.IndexSet.NotUnique
DataInvalid: ClassVar = OptimizationDataValidationError
Expand Down
2 changes: 1 addition & 1 deletion ixmp4/data/db/optimization/scalar/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .. import base


class Scalar(base.BaseModel, base.UniqueNameRunIDMixin):
class Scalar(base.BaseModel):
NotFound: ClassVar = abstract.Scalar.NotFound
NotUnique: ClassVar = abstract.Scalar.NotUnique
DeletionPrevented: ClassVar = abstract.Scalar.DeletionPrevented
Expand Down
6 changes: 1 addition & 5 deletions ixmp4/data/db/optimization/table/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
from .. import Column, base, utils


class Table(
base.BaseModel,
base.OptimizationDataMixin,
base.UniqueNameRunIDMixin,
):
class Table(base.BaseModel):
# NOTE: These might be mixin-able, but would require some abstraction
NotFound: ClassVar = abstract.Table.NotFound
NotUnique: ClassVar = abstract.Table.NotUnique
Expand Down
6 changes: 0 additions & 6 deletions tests/core/test_optimization_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ def df_from_list(tables: list[Table]):
table.data,
table.name,
table.id,
table.data,
table.name,
table.created_at,
table.created_by,
table.run_id,
]
for table in tables
],
Expand All @@ -34,11 +31,8 @@ def df_from_list(tables: list[Table]):
"data",
"name",
"id",
"data",
"name",
"created_at",
"created_by",
"run__id",
],
)

Expand Down
6 changes: 0 additions & 6 deletions tests/data/test_optimization_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ def df_from_list(tables: list):
table.data,
table.name,
table.id,
table.data,
table.name,
table.created_at,
table.created_by,
table.run__id,
]
for table in tables
],
Expand All @@ -32,11 +29,8 @@ def df_from_list(tables: list):
"data",
"name",
"id",
"data",
"name",
"created_at",
"created_by",
"run__id",
],
)

Expand Down

0 comments on commit 0b4896c

Please sign in to comment.