Skip to content

Allow dangling ports on EVs - #119

Merged
mikejturner merged 3 commits into
mainfrom
dangling-ports
Aug 25, 2026
Merged

Allow dangling ports on EVs#119
mikejturner merged 3 commits into
mainfrom
dangling-ports

Conversation

@mikejturner

Copy link
Copy Markdown
Contributor

This PR is all above preventing the following kinds of warnings from showing when using EVs:

UserWarning: Ports {'port_ECUXTqph2bYr5BqUX4ZWWi'} are defined on nodes but are not part of an edge. This may cause erroneous optimisation results.
  • Adds a new parameter allow_dangling_port to base Port model.
  • EVs has 2 ports that never can connected to other ports. These now have allow_dangling_port=True set on them.
  • Modify the check in verify_graph to not count any ports that have allow_dangling_port set to True.

@mikejturner

Copy link
Copy Markdown
Contributor Author

✅ Code coverage on dangling-ports is at 81% (compared to main being at 81%)

🎉 No files have reduced coverage 🎉

Full Coverage Report

File Details
src/echo/__init__.py ✅ 100% → 100%
src/echo/configuration.py ✅ 100% → 100%
src/echo/constants.py ✅ 100% → 100%
src/echo/exceptions.py ✅ 88% → 88%
src/echo/functional.py ✅ 100% → 100%
src/echo/models/__init__.py ✅ 100% → 100%
src/echo/models/agnostic.py ✅ 86% → 86%
src/echo/models/base.py ✅ 83% → 83%
src/echo/models/carbon.py ✅ 100% → 100%
src/echo/models/electrical.py ✅ 74% → 74%
src/echo/models/gas.py ✅ 73% → 73%
src/echo/models/prebuilt.py ✅ 56% → 56%
src/echo/models/scenario.py ✅ 100% → 100%
src/echo/models/thermal.py ✅ 81% → 81%
src/echo/objectives/__init__.py ✅ 100% → 100%
src/echo/objectives/base.py ✅ 98% → 98%
src/echo/objectives/contingency.py ✅ 93% → 93%
src/echo/objectives/power.py ✅ 86% → 86%
src/echo/objectives/tariff.py ✅ 80% → 80%
src/echo/optimiser.py ✅ 73% → 73%
src/echo/tracker.py ✅ 43% → 43%
src/echo/utils.py ✅ 61% → 61%
src/echo/validators.py ✅ 89% → 89%
src/echo/visualization.py ✅ 91% → 91%
TOTAL ✅ 81% → 81%

Comment thread src/echo/models/base.py Outdated
@mikejturner

Copy link
Copy Markdown
Contributor Author

✅ Code coverage on dangling-ports is at 81% (compared to main being at 81%)

🎉 No files have reduced coverage 🎉

Full Coverage Report

File Details
src/echo/__init__.py ✅ 100% → 100%
src/echo/configuration.py ✅ 100% → 100%
src/echo/constants.py ✅ 100% → 100%
src/echo/exceptions.py ✅ 88% → 88%
src/echo/functional.py ✅ 100% → 100%
src/echo/models/__init__.py ✅ 100% → 100%
src/echo/models/agnostic.py ✅ 86% → 86%
src/echo/models/base.py ✅ 83% → 83%
src/echo/models/carbon.py ✅ 100% → 100%
src/echo/models/electrical.py ✅ 74% → 74%
src/echo/models/gas.py ✅ 73% → 73%
src/echo/models/prebuilt.py ✅ 56% → 56%
src/echo/models/scenario.py ✅ 100% → 100%
src/echo/models/thermal.py ✅ 81% → 81%
src/echo/objectives/__init__.py ✅ 100% → 100%
src/echo/objectives/base.py ✅ 98% → 98%
src/echo/objectives/contingency.py ✅ 93% → 93%
src/echo/objectives/power.py ✅ 86% → 86%
src/echo/objectives/tariff.py ✅ 80% → 80%
src/echo/optimiser.py ✅ 73% → 73%
src/echo/tracker.py ✅ 43% → 43%
src/echo/utils.py ✅ 61% → 61%
src/echo/validators.py ✅ 89% → 89%
src/echo/visualization.py ✅ 91% → 91%
TOTAL ✅ 81% → 81%

@mikejturner

Copy link
Copy Markdown
Contributor Author

✅ Code coverage on dangling-ports is at 81% (compared to main being at 81%)

🎉 No files have reduced coverage 🎉

Full Coverage Report

File Details
src/echo/__init__.py ✅ 100% → 100%
src/echo/configuration.py ✅ 100% → 100%
src/echo/constants.py ✅ 100% → 100%
src/echo/exceptions.py ✅ 88% → 88%
src/echo/functional.py ✅ 100% → 100%
src/echo/models/__init__.py ✅ 100% → 100%
src/echo/models/agnostic.py ✅ 86% → 86%
src/echo/models/base.py ✅ 83% → 83%
src/echo/models/carbon.py ✅ 100% → 100%
src/echo/models/electrical.py ✅ 74% → 74%
src/echo/models/gas.py ✅ 73% → 73%
src/echo/models/prebuilt.py ✅ 56% → 56%
src/echo/models/scenario.py ✅ 100% → 100%
src/echo/models/thermal.py ✅ 81% → 81%
src/echo/objectives/__init__.py ✅ 100% → 100%
src/echo/objectives/base.py ✅ 98% → 98%
src/echo/objectives/contingency.py ✅ 93% → 93%
src/echo/objectives/power.py ✅ 86% → 86%
src/echo/objectives/tariff.py ✅ 80% → 80%
src/echo/optimiser.py ✅ 73% → 73%
src/echo/tracker.py ✅ 43% → 43%
src/echo/utils.py ✅ 61% → 61%
src/echo/validators.py ✅ 89% → 89%
src/echo/visualization.py ✅ 91% → 91%
TOTAL ✅ 81% → 81%

@mikejturner
mikejturner merged commit 663ef6a into main Aug 25, 2026
11 checks passed
@mikejturner
mikejturner deleted the dangling-ports branch August 25, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants