pyconvexity 0.5.1.post1__tar.gz → 0.5.1.post2__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.
Potentially problematic release.
This version of pyconvexity might be problematic. Click here for more details.
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/PKG-INFO +1 -1
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/pyproject.toml +2 -2
- pyconvexity-0.5.1.post2/src/pyconvexity/_version.py +1 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/solver.py +29 -3
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/PKG-INFO +1 -1
- pyconvexity-0.5.1.post1/src/pyconvexity/_version.py +0 -1
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/README.md +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/setup.cfg +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/database.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/errors.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/types.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/dashboard.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/README.md +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/loaders/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/loaders/cache.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/01_core_schema.sql +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/02_data_metadata.sql +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/03_validation_data.sql +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/sources/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/sources/gem.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/excel_exporter.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/excel_importer.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/netcdf_exporter.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/netcdf_importer.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/attributes.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/carriers.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/components.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/network.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/results.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/scenarios.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/api.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/batch_loader.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/builder.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/clearing_price.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/constraints.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/storage.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/timeseries.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/api.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/time_axis.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/validation/__init__.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/validation/rules.py +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/SOURCES.txt +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/dependency_links.txt +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/requires.txt +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/top_level.txt +0 -0
- {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/tests/test_core_types.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyconvexity"
|
|
7
|
-
version = "0.5.1.
|
|
7
|
+
version = "0.5.1.post2"
|
|
8
8
|
description = "Python library for energy system modeling and optimization with PyPSA"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -81,7 +81,7 @@ profile = "black"
|
|
|
81
81
|
line_length = 88
|
|
82
82
|
|
|
83
83
|
[tool.mypy]
|
|
84
|
-
python_version = "0.5.1.
|
|
84
|
+
python_version = "0.5.1.post2"
|
|
85
85
|
warn_return_any = true
|
|
86
86
|
warn_unused_configs = true
|
|
87
87
|
disallow_untyped_defs = true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.1.post2"
|
|
@@ -502,7 +502,11 @@ class NetworkSolver:
|
|
|
502
502
|
"""
|
|
503
503
|
try:
|
|
504
504
|
# Extract basic solve information
|
|
505
|
-
|
|
505
|
+
# PyPSA's result may be a tuple or object, and may not have a status attribute
|
|
506
|
+
raw_status = getattr(result, "status", None)
|
|
507
|
+
if raw_status is None:
|
|
508
|
+
raw_status = "unknown"
|
|
509
|
+
|
|
506
510
|
objective_value = getattr(network, "objective", None)
|
|
507
511
|
|
|
508
512
|
# Convert PyPSA result to dictionary format
|
|
@@ -510,12 +514,34 @@ class NetworkSolver:
|
|
|
510
514
|
|
|
511
515
|
# Determine success based on multiple criteria
|
|
512
516
|
success = self._determine_solve_success(
|
|
513
|
-
result, network,
|
|
517
|
+
result, network, raw_status, objective_value
|
|
514
518
|
)
|
|
519
|
+
|
|
520
|
+
# Update status to reflect the determined success
|
|
521
|
+
# This ensures database and API consumers get meaningful status values
|
|
522
|
+
if success:
|
|
523
|
+
# If we determined success, set status to "optimal" unless we have better info
|
|
524
|
+
if raw_status in ["optimal", "feasible"]:
|
|
525
|
+
status = raw_status
|
|
526
|
+
elif hasattr(result, "termination_condition"):
|
|
527
|
+
term_condition = str(result.termination_condition).lower()
|
|
528
|
+
if "optimal" in term_condition:
|
|
529
|
+
status = "optimal"
|
|
530
|
+
else:
|
|
531
|
+
status = "feasible" # Solved successfully but not necessarily optimal
|
|
532
|
+
else:
|
|
533
|
+
status = "optimal" # Default for successful solves
|
|
534
|
+
else:
|
|
535
|
+
# If solve failed, use raw status or "failed"
|
|
536
|
+
if raw_status not in ["unknown", "", None]:
|
|
537
|
+
status = raw_status
|
|
538
|
+
else:
|
|
539
|
+
status = "failed"
|
|
515
540
|
|
|
516
541
|
solve_result = {
|
|
517
542
|
"success": success,
|
|
518
|
-
"status": status,
|
|
543
|
+
"status": status, # Now contains meaningful status instead of "unknown"
|
|
544
|
+
"raw_status": raw_status, # Keep original PyPSA status for debugging
|
|
519
545
|
"solve_time": solve_time,
|
|
520
546
|
"solver_name": solver_name,
|
|
521
547
|
"run_id": run_id,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.5.1.post1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/loaders/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/01_core_schema.sql
RENAMED
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/02_data_metadata.sql
RENAMED
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/sources/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/batch_loader.py
RENAMED
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/builder.py
RENAMED
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/clearing_price.py
RENAMED
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/constraints.py
RENAMED
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/storage.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/time_axis.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|