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.

Files changed (54) hide show
  1. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/PKG-INFO +1 -1
  2. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/pyproject.toml +2 -2
  3. pyconvexity-0.5.1.post2/src/pyconvexity/_version.py +1 -0
  4. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/solver.py +29 -3
  5. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/PKG-INFO +1 -1
  6. pyconvexity-0.5.1.post1/src/pyconvexity/_version.py +0 -1
  7. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/README.md +0 -0
  8. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/setup.cfg +0 -0
  9. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/__init__.py +0 -0
  10. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/__init__.py +0 -0
  11. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/database.py +0 -0
  12. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/errors.py +0 -0
  13. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/core/types.py +0 -0
  14. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/dashboard.py +0 -0
  15. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/README.md +0 -0
  16. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/__init__.py +0 -0
  17. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/loaders/__init__.py +0 -0
  18. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/loaders/cache.py +0 -0
  19. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/01_core_schema.sql +0 -0
  20. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/02_data_metadata.sql +0 -0
  21. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/schema/03_validation_data.sql +0 -0
  22. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/sources/__init__.py +0 -0
  23. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/data/sources/gem.py +0 -0
  24. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/__init__.py +0 -0
  25. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/excel_exporter.py +0 -0
  26. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/excel_importer.py +0 -0
  27. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/netcdf_exporter.py +0 -0
  28. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/io/netcdf_importer.py +0 -0
  29. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/__init__.py +0 -0
  30. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/attributes.py +0 -0
  31. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/carriers.py +0 -0
  32. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/components.py +0 -0
  33. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/network.py +0 -0
  34. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/results.py +0 -0
  35. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/models/scenarios.py +0 -0
  36. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/__init__.py +0 -0
  37. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/__init__.py +0 -0
  38. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/api.py +0 -0
  39. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/batch_loader.py +0 -0
  40. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/builder.py +0 -0
  41. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/clearing_price.py +0 -0
  42. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/constraints.py +0 -0
  43. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/solvers/pypsa/storage.py +0 -0
  44. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/timeseries.py +0 -0
  45. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/__init__.py +0 -0
  46. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/api.py +0 -0
  47. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/transformations/time_axis.py +0 -0
  48. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/validation/__init__.py +0 -0
  49. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity/validation/rules.py +0 -0
  50. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/SOURCES.txt +0 -0
  51. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/dependency_links.txt +0 -0
  52. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/requires.txt +0 -0
  53. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/src/pyconvexity.egg-info/top_level.txt +0 -0
  54. {pyconvexity-0.5.1.post1 → pyconvexity-0.5.1.post2}/tests/test_core_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyconvexity
3
- Version: 0.5.1.post1
3
+ Version: 0.5.1.post2
4
4
  Summary: Python library for energy system modeling and optimization with PyPSA
5
5
  Author-email: Convexity Team <info@convexity.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyconvexity"
7
- version = "0.5.1.post1"
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.post1"
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
- status = getattr(result, "status", "unknown")
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, status, objective_value
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyconvexity
3
- Version: 0.5.1.post1
3
+ Version: 0.5.1.post2
4
4
  Summary: Python library for energy system modeling and optimization with PyPSA
5
5
  Author-email: Convexity Team <info@convexity.com>
6
6
  License: MIT
@@ -1 +0,0 @@
1
- __version__ = "0.5.1.post1"