-
Notifications
You must be signed in to change notification settings - Fork 2
[Feature] [WIP] - implement the app in python #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fa3fd2a
Migrates the C# application to a python app
liamlaverty d967ea0
udates the readme files
liamlaverty 3fe553a
updates python docstrings
liamlaverty 4cb183b
Adds poetry
liamlaverty 08b2275
[wip] implementing tests
liamlaverty 6bb1f58
adds test docstrings
liamlaverty 89f2a07
updates readme to describe the unit tests
liamlaverty 7492d1c
Adds a sample demo application
liamlaverty 8d90d68
Update README.md
liamlaverty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Python Demo Console App for Open-IMO-CII-Calculator | ||
|
||
This directory contains a small Python console application that mirrors the demo functionality of the C# app in `EtiveMor.OpenImoCiiCalculator.DemoConsoleApp`. | ||
|
||
- See `main.py` for entry point. | ||
- Run with: `python main.py` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.json | ||
|
||
!3b6c5150-8e0a-45bf-9094-5edb474d04ee-multi-fuel-demo.json | ||
!35acf7dc-60a3-4a6a-9773-a22c9f5fc699-single-fuel-demo.json | ||
!b3fa068c-1312-4486-8090-ca2f2faf27a3-single-fuel-gas-carrier-demo.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This directory will contain output JSON files from demo runs. | ||
# Files are named as {uuid}-single-fuel-demo.json or {uuid}-multi-fuel-demo.json |
328 changes: 328 additions & 0 deletions
328
.../demo-console-app/demo-results/35acf7dc-60a3-4a6a-9773-a22c9f5fc699-single-fuel-demo.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,328 @@ | ||
{ | ||
"results": [ | ||
{ | ||
"is_measured_year": true, | ||
"is_estimated_year": false, | ||
"year": 2019, | ||
"required_cii": 19.184190519387734, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.8467249799733408, | ||
"rating": 2, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2019, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 14.579984794734678, | ||
"2": 17.649455277836715, | ||
"3": 21.869977192102013, | ||
"4": 24.939447675204054 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2020, | ||
"required_cii": 18.992348614193855, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.8552777575488293, | ||
"rating": 2, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2020, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 14.43418494678733, | ||
"2": 17.472960725058346, | ||
"3": 21.651277420180993, | ||
"4": 24.690053198452013 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2021, | ||
"required_cii": 18.80050670899998, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.8640050816054499, | ||
"rating": 2, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2021, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 14.288385098839985, | ||
"2": 17.29646617227998, | ||
"3": 21.432577648259976, | ||
"4": 24.440658721699975 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2022, | ||
"required_cii": 18.6086648038061, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.8729123504879803, | ||
"rating": 2, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2022, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 14.142585250892637, | ||
"2": 17.119971619501612, | ||
"3": 21.21387787633895, | ||
"4": 24.19126424494793 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2023, | ||
"required_cii": 18.224980993418345, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.8912894526035168, | ||
"rating": 2, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2023, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 13.850985554997942, | ||
"2": 16.76698251394488, | ||
"3": 20.77647833249691, | ||
"4": 23.69247529144385 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2024, | ||
"required_cii": 17.84129718303059, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.9104569677132699, | ||
"rating": 2, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2024, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 13.55938585910325, | ||
"2": 16.413993408388144, | ||
"3": 20.33907878865487, | ||
"4": 23.19368633793977 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2025, | ||
"required_cii": 17.45761337264284, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.9304670109597152, | ||
"rating": 3, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2025, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 13.267786163208559, | ||
"2": 16.061004302831414, | ||
"3": 19.901679244812836, | ||
"4": 22.69489738443569 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2026, | ||
"required_cii": 17.073929562255085, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.9513763819925177, | ||
"rating": 3, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2026, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 12.976186467313864, | ||
"2": 15.708015197274678, | ||
"3": 19.464279700970796, | ||
"4": 22.196108430931613 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2027, | ||
"required_cii": 16.690245751867327, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.9732471034176333, | ||
"rating": 3, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2027, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 12.684586771419168, | ||
"2": 15.35502609171794, | ||
"3": 19.02688015712875, | ||
"4": 21.697319477427527 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2028, | ||
"required_cii": 16.306561941479572, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 0.996147035262754, | ||
"rating": 3, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2028, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 12.392987075524475, | ||
"2": 15.002036986161206, | ||
"3": 18.58948061328671, | ||
"4": 21.198530523923445 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2029, | ||
"required_cii": 15.922878131091819, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 1.0201505782811335, | ||
"rating": 3, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2029, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 12.101387379629783, | ||
"2": 14.649047880604474, | ||
"3": 18.152081069444673, | ||
"4": 20.699741570419366 | ||
} | ||
} | ||
}, | ||
{ | ||
"is_measured_year": false, | ||
"is_estimated_year": true, | ||
"year": 2030, | ||
"required_cii": 15.539194320704066, | ||
"attained_cii": 16.243733333333335, | ||
"attained_required_ratio": 1.0453394814485688, | ||
"rating": 3, | ||
"calculated_co2e_emissions": 60914000000.0, | ||
"calculated_ship_capacity": 25000, | ||
"calculated_transport_work": 3750000000, | ||
"vector_boundaries_for_year": { | ||
"year": 2030, | ||
"ship_type": 110, | ||
"weight_classification": { | ||
"upper_limit": 0, | ||
"lower_limit": Infinity | ||
}, | ||
"capacity_unit": 3, | ||
"boundary_dd_vectors": { | ||
"1": 11.80978768373509, | ||
"2": 14.296058775047742, | ||
"3": 17.714681525602632, | ||
"4": 20.200952616915288 | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.