Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
346 commits
Select commit Hold shift + click to select a range
12e6241
Added handlers for S1 and S2 targets
MichaelTiemannOSC Feb 22, 2022
7255845
Update environment.yml
MichaelTiemannOSC Feb 22, 2022
2dbe086
Move target projection to class
Feb 22, 2022
8edb6fd
Fix getting latest target value when multiple targets in target proje…
Feb 22, 2022
8a48e48
Update environment.yml
MichaelTiemannOSC Feb 22, 2022
7d0438b
Add S1 and S2 scopes to EI target projector class
Feb 22, 2022
4f18e1e
Copy comments to EITargetProjector and delete target_utils
Feb 22, 2022
6a0ec7d
Remove incorrect comment
Feb 22, 2022
0d957c4
Generate target projections for S1 and S2 scopes individually
MichaelTiemannOSC Feb 22, 2022
d55be13
Test cases can now run with Sample data.
MichaelTiemannOSC Feb 22, 2022
68af70d
First draft of runnable notebook demo
MichaelTiemannOSC Feb 23, 2022
b4663d3
Update environment.yml
MichaelTiemannOSC Feb 23, 2022
04ce7a1
Accept Asia as a region value
MichaelTiemannOSC Feb 23, 2022
ec8af16
Correcet CAGR calculation
MichaelTiemannOSC Feb 23, 2022
2834ba0
Enable netzero_year functionality
MichaelTiemannOSC Feb 24, 2022
5a6f9e1
Update .gitignore
MichaelTiemann Feb 24, 2022
e8a902e
Move _calculate_target_projections into DataWarehouse (and other clea…
MichaelTiemannOSC Feb 25, 2022
925317e
Update template.py
MichaelTiemannOSC Feb 25, 2022
8539675
Create unitized version of GUI app
MichaelTiemannOSC Feb 25, 2022
eb85f44
Cleanup and fixing of some tests
Feb 25, 2022
1752edb
Clean up GHG_SCOPE12 confusion
MichaelTiemannOSC Feb 26, 2022
96f316d
Update ITR_dash_app_develop.py
MichaelTiemannOSC Feb 26, 2022
9bbf0ab
Fix damage to ExcelProviders code resulting from TemplateProviders en…
MichaelTiemannOSC Feb 26, 2022
e07cabb
Add PPL data and targets
MichaelTiemannOSC Feb 26, 2022
bbb5510
Cleanup and add base year production data to test data json file
Feb 27, 2022
488e550
Attempt at cleanup, renaming, fixing tests
Feb 27, 2022
2f6dd4e
Update test_template_provider.py
MichaelTiemannOSC Feb 28, 2022
e3ccec5
Create country_region_info.csv
MichaelTiemannOSC Feb 28, 2022
aefe26f
Enable reading local data files and read mapping file from countries …
MichaelTiemannOSC Feb 28, 2022
f9de26d
Update setup.py
MichaelTiemannOSC Feb 28, 2022
8400c51
Update tests
Feb 28, 2022
8a1b1eb
Update ITR_dash_app_develop.py
MichaelTiemannOSC Feb 28, 2022
e79b3c2
Fix some tests
Feb 28, 2022
f2ec9ff
Fix test and 2019 AES corp production data
Feb 28, 2022
f7fc992
Remove non-idiomatic use of .keys()
MichaelTiemannOSC Mar 1, 2022
ad1e953
Update base provider test values
Mar 1, 2022
c772f83
Fix excel, base and template provider unit tests - all work now
Mar 1, 2022
c6143db
Fix GitHub CI unit testing
Mar 1, 2022
eaa9406
Fix portfolio aggregation unit test
Mar 1, 2022
e6549be
Update test_e2e.py
MichaelTiemannOSC Mar 1, 2022
a98bea0
Fix another emission_intensity -> emissions_intensity issue
MichaelTiemannOSC Mar 1, 2022
d43532c
Update test_temperature_score.py
MichaelTiemannOSC Mar 3, 2022
a74dff7
Cleanup
Mar 2, 2022
804efd5
Major rework of ICompanyData to handle historic data better (WIP)
MichaelTiemannOSC Mar 3, 2022
bac960a
Get test_excel_provider.py working again
MichaelTiemannOSC Mar 3, 2022
47e01f7
Get test_interfaces.py working again
MichaelTiemannOSC Mar 3, 2022
a8621d9
test_template_provider mostly working again
MichaelTiemannOSC Mar 3, 2022
df99ef3
Update template sample data file for Notebook
MichaelTiemannOSC Mar 3, 2022
77a2b47
Also update sample data in main test area
MichaelTiemannOSC Mar 3, 2022
cdbc39c
test_projection WIP
MichaelTiemannOSC Mar 3, 2022
03aa050
Spiff up trajectory calculation to compute S1S2 = S1+S2
MichaelTiemannOSC Mar 4, 2022
61dd9b9
Update template.py
MichaelTiemannOSC Mar 4, 2022
4997249
Update test_template_provider.py
MichaelTiemannOSC Mar 4, 2022
4731fa5
Fixed nan vs. pd.NA confusion from previous change
MichaelTiemannOSC Mar 4, 2022
f10dc1e
Revert "Fixed nan vs. pd.NA confusion from previous change"
MichaelTiemannOSC Mar 4, 2022
97949fb
Update base_providers.py
MichaelTiemannOSC Mar 4, 2022
0881d09
Don't use report_date to find most recent production/emission data
MichaelTiemannOSC Mar 5, 2022
d030b8c
Update environment.yml
MichaelTiemannOSC Mar 5, 2022
fa1e505
Update environment.yml
MichaelTiemannOSC Mar 5, 2022
0b73672
Update interfaces.py
MichaelTiemannOSC Mar 6, 2022
e4878b7
Update interfaces.py
MichaelTiemannOSC Mar 6, 2022
61837f2
Add many more dependencies since we cannot (yet) depend on PyPi.
MichaelTiemannOSC Mar 7, 2022
f75da5c
Update template.py
MichaelTiemannOSC Mar 6, 2022
b8fa7a3
Update data_warehouse.py
MichaelTiemannOSC Mar 6, 2022
04fc467
Add more rows to Sample Data template spreadsheet
MichaelTiemannOSC Mar 6, 2022
7c48868
Update quick_template_score_calc.ipynb
MichaelTiemannOSC Mar 6, 2022
2eb7efa
Draft documentation and sample data
MichaelTiemannOSC Mar 7, 2022
84fd00f
_emission_intensity -> _ei in test files
MichaelTiemannOSC Mar 7, 2022
c70bef5
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
00182a0
Create Calculation.md
MichaelTiemannOSC Mar 7, 2022
86f99fc
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
55e0538
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
56c9653
Update requirements.txt and conda env yaml
Mar 7, 2022
501caba
My OSX build environment is broken and does not tolerate building pyt…
MichaelTiemannOSC Mar 7, 2022
e9b5c49
The notebook code to access the Github branch was written using PyGit…
MichaelTiemannOSC Mar 7, 2022
735b925
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
66d2ef7
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
c132e2c
Update test projection reference json files
Mar 7, 2022
cce9747
Restore notebook to work with pygithub
Mar 7, 2022
e83ffc4
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
ffdee85
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
8b578e2
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
312348e
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
a5819d4
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
0404cc1
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
e0f2114
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 7, 2022
b256bad
Fix template tests - fix input data and ref value
Mar 8, 2022
369bcb2
Disable single unit test for template provider
Mar 8, 2022
2d9eef2
Update base_providers.py
MichaelTiemannOSC Mar 9, 2022
25904d1
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 9, 2022
c266644
Update interfaces.py
MichaelTiemannOSC Mar 9, 2022
0d2781d
Update interfaces.py
MichaelTiemannOSC Mar 9, 2022
482c40f
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 9, 2022
3b4524b
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 9, 2022
c942f56
updated documentation
HeatherAck Mar 10, 2022
a6542e1
fixed formatting
HeatherAck Mar 10, 2022
2484dca
updated wording in loading your own data section
HeatherAck Mar 10, 2022
aa9d67c
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 10, 2022
b149e02
Update DataTemplateRequirements.rst
MichaelTiemannOSC Mar 10, 2022
1ec3332
Update interfaces.py
MichaelTiemannOSC Mar 15, 2022
6868616
Update test_interfaces.py
MichaelTiemannOSC Mar 15, 2022
6cec96b
Update sample input with more/better S1, S2, and S3 data
MichaelTiemannOSC Apr 17, 2022
eed642e
Update to latest input spreadsheet
MichaelTiemannOSC Apr 18, 2022
f7161ee
WIP now passes test_vault_providers testcase
MichaelTiemannOSC May 3, 2022
13bc7fa
Better way around unifying Base and Vault Warehouses
MichaelTiemannOSC May 3, 2022
a163a3f
Minor fixes
MichaelTiemannOSC May 3, 2022
df22cd1
Complete dissociation of vault "company_data" from baseprovider "comp…
MichaelTiemannOSC May 4, 2022
2b6a038
Complete integration of Pint Units into DataVault prototype
MichaelTiemannOSC May 5, 2022
6c67f0a
Add typemap parameter to requantify_df
MichaelTiemannOSC May 5, 2022
9b3ac75
Fresh run to put cell output numbers in order
MichaelTiemannOSC May 5, 2022
7f55864
Update DataTemplateRequirements.rst
MichaelTiemannOSC May 3, 2022
f73de12
Update DataTemplateRequirements.rst
MichaelTiemannOSC May 5, 2022
bf0131c
Support flexible projection controls
MichaelTiemannOSC May 6, 2022
65a5250
Move json comparison to function
dp90 May 19, 2022
76c9eff
Change argument type of projection control in BaseCompanyDataProvider…
dp90 May 19, 2022
fcd4f1a
Adding check for sectors in scope while reading xlsx with input data
olanuf May 16, 2022
400eda1
Adding check for missing market capitalization and calculating dummy …
olanuf May 17, 2022
f2666eb
Adding check for the case of several currencies used in the excel tem…
olanuf May 17, 2022
255d1d4
Adding check for emty cells in portfolio input file
olanuf May 17, 2022
f24601a
Adjusting the code based on the feedback from David
olanuf May 20, 2022
3118d79
Add logger and remove assertions + some cleanup
dp90 May 23, 2022
7bedbff
Add try except to converter and remove unnecessary functions
dp90 Jun 2, 2022
39e0c4a
Replace assertions with errors
dp90 Jun 2, 2022
a4670cb
Replace assertions with errors and add logging
dp90 Jun 2, 2022
4a6ab14
Add checks to target input data
dp90 Jun 3, 2022
42696a5
Refactor logging formatting
dp90 Jun 17, 2022
8801619
Add logger config with function
dp90 Jun 17, 2022
caaa92f
Set warning to error and fix failing test - target year in template t…
dp90 Jun 17, 2022
e7a8985
Update vulnerability scan
dp90 May 25, 2022
5a45093
Edit github action commands
dp90 May 25, 2022
042af5f
Fix vulnerability
dp90 May 25, 2022
8c6bce8
Remove temporary test branch from github action
dp90 May 25, 2022
4f16d00
fall back if trajectory score is known and target score is nan -> tem…
joriscram Apr 25, 2022
a02a2e4
introduced score result types
joriscram Apr 25, 2022
591d910
Numeric binary default temp score input in aggregation
dp90 Apr 25, 2022
fe3936e
fix quantity from scoretype
joriscram Apr 25, 2022
6fae6f2
Fix score type reference
dp90 Apr 25, 2022
3d5bb21
Remove unnecessary zip
dp90 Apr 25, 2022
76300c8
Move deg c type casting to appropriate place
dp90 Apr 25, 2022
9e14708
Tests on different scenarios:
Casjiskoot98 May 10, 2022
5f6c6d3
Move ragged edges fix to target projection
dp90 May 16, 2022
649bb6f
Refactor checks for default score assignment
dp90 May 16, 2022
c0dc729
Log warning if target base year data is estimated from trajectory
dp90 May 18, 2022
a0964d2
Update docstring to reflect argument changes
dp90 May 25, 2022
5c23314
Update dependencies with vulnerabilities
dp90 May 25, 2022
4e35039
GHG_SCOPE12 and GHG_SCOPE3 are emissions, not production
MichaelTiemann Jun 3, 2022
3275006
Update TPI benchmarks
dp90 May 18, 2022
dc8c9d5
Update TPI benchmarks
dp90 May 18, 2022
6764ded
Remove unused script
dp90 May 18, 2022
8b97977
Update TPI benchmarks in unitized jsons
dp90 May 18, 2022
899ecd4
Add auto sector units to EmissionMetric
dp90 May 19, 2022
094fc81
Fix missing unit in tpi jsons
dp90 Jun 2, 2022
d2c93e1
Spell North America without dash
dp90 Jun 2, 2022
f58fe92
Update for UI. UI could be used for release.
olanuf Jun 3, 2022
2f46b0b
Adding gif, delete old UI
olanuf Jun 3, 2022
25741b2
Finalising _get_intensity_benchmarks() for reg-sec combinations
olanuf Jun 3, 2022
7857f29
Cleanning UI after feedback from Joris and David
olanuf Jun 14, 2022
150b14b
Revert "Merge branch 'develop-logging' into develop"
dp90 Jun 17, 2022
9c4f988
Implement logging
dp90 Jun 17, 2022
852ae59
Remove Exelon Corp from target data - target already expired
dp90 Jun 21, 2022
466623a
Added OECD show-and-tell
MichaelTiemann Jun 6, 2022
9d82b1a
Move data input files to separate directory and remove experiment files
dp90 Jun 21, 2022
7da2bd4
Edit moved file name references
dp90 Jun 21, 2022
9214805
Allow missing target data - score will be based on trajectory
dp90 Jun 22, 2022
30dc06e
Update required packages
dp90 Jun 22, 2022
eda5059
Update requirements - checked to be able to run notebooks and UI
dp90 Jun 22, 2022
ee4c6fd
Update requirements - checked to be able to run notebooks and UI
dp90 Jun 22, 2022
ed3ce08
Add signoff write to file template
dp90 Jul 8, 2022
12537b6
Add signoff write to file template
dp90 Jul 8, 2022
b02e809
Change imports
dp90 Jul 8, 2022
077311a
Fix no file if no unsigned commits
dp90 Jul 8, 2022
53c1327
Add DCO signoff file for David Kroon and Jur de Jong
dp90 Jul 8, 2022
fdc013f
generated dco sign-offs for all non signed commits in develop
joriscram Jul 11, 2022
deb8305
Update OECM benchmarks
dp90 Jul 15, 2022
0328c47
Update OECM benchmark jsons with units
dp90 Jul 15, 2022
a56d2b9
Add GH workflow for autopublish on push to main
dp90 Jul 17, 2022
e3ea033
Add GH workflow for autopublish on push to main
dp90 Jul 17, 2022
ff6fcc0
Trigger PR action
dp90 Jul 17, 2022
311ca66
test PR action
dp90 Jul 17, 2022
2a45ace
Fix typo in test pypi url
dp90 Jul 17, 2022
7c08e8c
Correct test pypi url
dp90 Jul 17, 2022
21e480a
Change version number and pypi description
dp90 Jul 17, 2022
a85de2a
Create Additional materials.md
alexanu Sep 16, 2021
67ff027
Update Additional materials.md
alexanu Sep 16, 2021
3d67ac0
Update Additional materials.md
alexanu Sep 16, 2021
a5272cf
Update Additional materials.md
alexanu Sep 16, 2021
e401efe
Adding dash script
alexanu Sep 27, 2021
4d3ce91
Remove unused files
dp90 Jul 17, 2022
90e540f
Remove unused github action
dp90 Jul 17, 2022
07d931b
Add GH action for test pypi
dp90 Jul 17, 2022
a4f1950
Add checks to GH publish to pypi action
dp90 Jul 17, 2022
48479ae
Improve naming of GH workflows
dp90 Jul 17, 2022
91dc2a1
Avoid linting errors on pint units
dp90 Jul 17, 2022
72533dc
Add mypy specifications
dp90 Jul 17, 2022
bc13e38
Avoid mypy errors on pint units
dp90 Jul 17, 2022
48f7e86
Add python 3.8 and 3.10 to auto testing and requirements
dp90 Aug 3, 2022
9366334
Update versions and quotes
dp90 Aug 3, 2022
ff8ab99
Rewrite dict concatenation and cleanup
dp90 Aug 3, 2022
ae0e9c8
Fix vulnerability
dp90 Aug 3, 2022
79916e9
Update audit workflow
dp90 Aug 3, 2022
82b7726
Create benchmark dataframes inside the scope of inhibited warnings.
MichaelTiemannOSC Sep 6, 2022
1c3a8ed
Wrap calculation of benchmark projections to ignore warnings precipit…
MichaelTiemannOSC Sep 7, 2022
459d32e
Increment version number
dp90 Sep 7, 2022
531fb86
Add/adjust sector and unit handling for O&G (boe) and Autos (passenge…
MichaelTiemannOSC Jul 20, 2022
3651f4a
Use generic ProductionMetric instead of specialized metic constructor…
MichaelTiemannOSC Jul 20, 2022
de0f438
Fix compatibility checks for automotive metrics (passenger_km).
MichaelTiemannOSC Sep 7, 2022
1c716e3
Add Oil & Gas and Autos as sectors.
MichaelTiemannOSC Sep 7, 2022
cec4321
Fix up unit errors in O&G and Autos. Also remove below 2-degree Auto…
MichaelTiemannOSC Sep 8, 2022
f8b689b
Update DataTemplateRequirements.rst
MichaelTiemannOSC Sep 8, 2022
612280c
Update DataTemplateRequirements.rst
MichaelTiemannOSC Sep 8, 2022
e2df6d0
Update DataTemplateRequirements.rst
MichaelTiemannOSC Sep 8, 2022
101f81d
Further fix Autos by making production metric flexible between km, mi…
MichaelTiemannOSC Sep 10, 2022
f12defc
Add parentheses around `passenger km`
MichaelTiemannOSC Sep 11, 2022
3131f7d
More unit fixes (mboe, mmboe) and parentheses protecting potential co…
MichaelTiemannOSC Sep 11, 2022
0f0f97c
Add file promised, but not added to, last commit.
MichaelTiemannOSC Sep 11, 2022
b7cfb9a
Update template spreadsheet with more/better data for O&G and Autos.
MichaelTiemannOSC Sep 11, 2022
c76766c
Add several additional Autos companies to experiment with S3 emission…
MichaelTiemannOSC Sep 12, 2022
a4c1432
added data in setup.py + minor revisions in README.md
joriscram Sep 8, 2022
1f581ec
minor revisions in README.md
joriscram Sep 8, 2022
9aa87c5
Allow GUI to read from a filename argument. Fix XLSX data damaged by…
MichaelTiemannOSC Sep 13, 2022
e904bf1
Fix ITR_UI.py handling of default template file if no parameters give…
MichaelTiemannOSC Sep 14, 2022
188135e
Initial Scope 3 support aligned with OECM 2.0
MichaelTiemannOSC Sep 19, 2022
2c38783
hotfix - cmd line arguments ui set to optional
joriscram Sep 15, 2022
256a8f7
Fix wrong conflict resolution (variable `root` is otherwise undefined).
MichaelTiemannOSC Sep 22, 2022
1634132
Add unit handlers for additional sectors (Aluminum, Buildings, Cement…
MichaelTiemannOSC Sep 26, 2022
1f88e63
Add tkm units for freight. Should think about metric for "Built m^2"…
MichaelTiemannOSC Sep 26, 2022
5199c79
Allow use of newly computed Production-Centric (PC) and vanilla (S3) …
MichaelTiemannOSC Sep 26, 2022
ceddaa8
Updated benchmarks with `production_centric` value (true or false) to…
MichaelTiemannOSC Sep 26, 2022
aac042d
Pick up benchmark files with values that are better rounded by OECM-b…
MichaelTiemannOSC Sep 27, 2022
f2e7623
Actually push new sector handling functionality into tool source code.
MichaelTiemannOSC Sep 27, 2022
9b11d36
Disaggregate Buildings into Construction, Residential, and Commerical…
MichaelTiemannOSC Sep 28, 2022
f41d66f
Add CBRE and Balfour Beatty PLC data.
MichaelTiemannOSC Sep 28, 2022
112764e
Finish fixes to test cases so CI/CD can work again.
MichaelTiemannOSC Sep 29, 2022
becef2d
Add benchmark files to test directory. Somehow missed in the previou…
MichaelTiemannOSC Sep 29, 2022
f5b4595
Added zmin and zmax so heatmap in UI doesn't wrongly stretch to fit d…
MichaelTiemannOSC Sep 29, 2022
fa11e74
TemplateProviderCompany: Add validation of company ids
kmarinushkin Aug 19, 2022
12b09e0
TemplateProviderCompany: In error log, print company id instead of name
kmarinushkin Aug 19, 2022
4620fb7
json-units: Reduce benchmark_EI_OECM_S3 to S3
kmarinushkin Sep 30, 2022
d0511c6
base_providers: Add property scope_to_calc
kmarinushkin Sep 27, 2022
892c710
base_providers: Production benchmarks are relevant to any scope
kmarinushkin Sep 29, 2022
b6cc3bd
base_providers: Provide scope as argument to different methods
kmarinushkin Sep 28, 2022
f5c2e17
ITR_UI: Calculate for benchmark scope_to_calc
kmarinushkin Sep 29, 2022
18e21a7
temperature_score: For S3 calculations, filter out empty rows
kmarinushkin Sep 30, 2022
5154ae3
ITR_UI: Cleanup use of term 'scenario' instead of 'benchmark'
kmarinushkin Oct 2, 2022
0853819
quick_template_score_calc.ipynb: Removed unused github token
kmarinushkin Oct 17, 2022
d6519bb
base_providers: Add a w/a for EI benchmarks, not available for S3
kmarinushkin Oct 24, 2022
2c3b55b
s1s2_s3_calc.ipynb: Add jupiter notebook for S1S2 / S3 calculation
kmarinushkin Oct 24, 2022
6d4cfa7
Update gh-action-pip-audit and setuptools vers
eb-oss Dec 8, 2022
a80dd4a
Merge branch 'develop' into develop-project-vault-iceberg
MichaelTiemannOSC Feb 15, 2023
2cb302a
Update missing packages
dp90 Feb 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ITR/data/data_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ def get_company_projected_targets(self, company_ids: List[str]) -> pd.DataFrame:
"""
raise NotImplementedError

@abstractmethod
def get_company_fundamentals(self, company_ids: List[str]) -> pd.DataFrame:
"""
:param company_ids: A list of company IDs
:return: A pandas DataFrame with company fundamental info per company
"""
raise NotImplementedError


class ProductionBenchmarkDataProvider(ABC):
"""
Expand Down
1 change: 0 additions & 1 deletion ITR/data/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ def _get_historic_data(self, company_ids: List[str], historic_data: pd.DataFrame
:return: historic data with unit attributes added to yearly data on a per-element basis
"""
self.historic_years = [column for column in historic_data.columns if type(column) == int]

missing_ids = [company_id for company_id in company_ids if company_id not in historic_data.index]
if missing_ids:
error_message = f"Company ids missing in provided historic data: {missing_ids}"
Expand Down
2 changes: 1 addition & 1 deletion ITR/data/osc_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This module handles initialization of pint functionality
"""

from pint import set_application_registry
from pint import set_application_registry, Quantity
from pint_pandas import PintArray, PintType
from openscm_units import unit_registry
import re
Expand Down
606 changes: 606 additions & 0 deletions ITR/data/vault_providers.py

Large diffs are not rendered by default.

27 changes: 20 additions & 7 deletions examples/ITR_UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
import sys
import argparse

# Initial calculations


examples_dir = '' # 'examples'
data_dir = "data"
data_json_units_dir = "json-units"
root = os.path.abspath('')

# Set input filename (from commandline or default)
parser = argparse.ArgumentParser()
parser.add_argument('-file')
args = parser.parse_args()
company_data_path = args.file or os.path.join(root, examples_dir, data_dir, "20220720 ITR Tool Sample Data.xlsx")

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -681,7 +694,6 @@ def agg_score(agg_method):
agg_s3 = [agg_method.value,aggregated_scores.long.S3.all.score]
else:
agg_s3 = []

return agg_s1s2 + agg_s3

agg_temp_scores = [agg_score(i) for i in PortfolioAggregationMethod]
Expand Down Expand Up @@ -747,12 +759,13 @@ def agg_score(agg_method):
fig1, fig5,
heatmap_fig, high_score_fig,
port_score_diff_methods_fig,
"{:.2f}".format(scores), # fake for spinner
"{:.2f}".format(scores), # portfolio score
{'color': 'ForestGreen'} if scores < 2 else {'color': 'Red'}, # conditional color
str(round((filt_df.company_ev_plus_cash.sum())/10**9,0)), # sum of total EVIC for companies in portfolio
str(round((filt_df.investment_value.sum())/10**6,1)), # portfolio notional
str(len(filt_df)), # num of companies
"{:.2f}".format(aggregated_scores.long.S1S2.all.score.m), # fake for spinner
"{:.2f}".format(aggregated_scores.long.S1S2.all.score.m), # portfolio score
{'color': 'ForestGreen'} if aggregated_scores.long.S1S2.all.score.m < 2 else {'color': 'Red'},
# conditional color
str(round((filt_df.company_ev_plus_cash.sum()) / 10 ** 9, 0)), # sum of total EVIC for companies in portfolio
str(round((filt_df.investment_value.sum()) / 10 ** 6, 1)), # portfolio notional
str(len(filt_df)), # num of companies
dbc.Table.from_dataframe(df_for_output_table,
striped=True,
bordered=True,
Expand Down
62 changes: 62 additions & 0 deletions examples/data/mdt-20220116-portfolio.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
company_name;company_lei;company_id;investment_value
AES Corp.;2NUNNB7D43COUIRE5295;US00130H1059;4351252
Algonquin Power & Utilities Corp.;549300K5VIUTJXQL7X75;US0158577090;2228185
ALLETE, Inc.;549300NNLSIMY6Z8OT86;US0185223007;3829481
Alliant Energy;5493009ML300G373MZ12;US0188021085;3829481
Ameren Corp.;XRZQ5S7HYJFPHJ78L959;US0236081024;15917812
American Electric Power Co., Inc.;1B4S6S7G0TW5EE83BO58;US0255371017;45520637
Avangrid, Inc.;549300OX0Q38NLSKPB49;US05351W1036;10049068
Avista Corp.;Q0IK63NITJD6RJ47SW96;US05379B1070;2804211
Cleco Partners LP;5493002H80P81B3HXL31;US18551QAA58;3086052
CMS Energy;549300IA9XFBAGNIBW29;US1258961002;9153135
Consolidated Edison, Inc.;54930033SBW53OO8T749;US2091151041;20394113
Dominion Energy;ILUL7B6Z54MRYCF6H308;US25746U1097;33528082
DTE Energy;549300IX8SD6XXD71I78;US2333311072;14329945
Duke Energy Corp.;I1BZKREC126H0VB1BL91;US26441C2044;73069652
El Paso Electric Co;OZ8GM8L4AHPKSWZMW205;US283677AZ52;2646941
Emera Inc.;NQZVQT2P5IUF2PGA1Q48;CA2908761018;6631113
Entergy Corp.;4XM3TW50JULSLG8BNC79;US29364G1031;29844269
Evergy, Inc.;549300PGTHDQY6PSUI61;US30034W1062;18254954
Eversource Energy;SJ7XXD41SQU3ZNWUJ746;US30040W1080;18962480
FirstEnergy Corp.;549300SVYJS666PQJH88;US3379321074;27277340
Fortis, Inc;549300MQYQ9Y065XPR71;CA3495531079;12428756
MDU Resources Group;0T6SBMK3JTBI1JR36794;US5526901096;1207049
National Grid plc;8R95QZMKZLJX5Q2XR704;US6362744095;12281584
NorthWestern Corp.;3BPWMBHR1R9SHUN7J795;US6680743050;2703150
OG&E Energy;CE5OG6JPOZMDSA0LAQ19;US6708371033;7251242
Otter Tail Corp.;549300HHVBQRQUVKKD91;US6896481032;1264277
Pinnacle West Capital Corp.;TWSEY0NEDUDCKS27AH81;US7234841010;12058547
PNM Resources, Inc.;5493003JOBJGLZSDDQ28;US69349H1077;3326899
Portland General Electric Co.;GJOUP9M7C39GLSK9R870;US7365088472;5770964
PPL;9N3UAJSNOUXFKQLF3V18;US69351T1060;18146577
Public Service Enterprise Group;PUSS41EMO3E6XXNV3U28;US7445731067;16912134
Sempra Energy;PBBKGKLRK5S5C0Y4T545;US8168511090;29579515
Southern Co.;549300FC3G3YU2FBZD92;US8425871071;50294245
WEC Energy Group;549300IGLYTZUK3PVP70;US92939U1060;11046675
Xcel Energy, Inc.;LGJNMI9GH8XIDG5RCM61;US98389B1008;27475073
AK STEEL HOLDING CORP;529900DT4E7ZNETMVC04;US0015471081;10000000
ARCELORMITTAL;2EULGUTUI56JI9SAL165;LU0140205948;10000000
CARPENTER TECHNOLOGY CORP;DX6I6ZD3X5WNNCDJKP85;US1442851036;10000000
COMMERCIAL METALS CO;549300OQS2LO07ZJ7N73;US2017231034;10000000
FRIEDMAN INDUSTRIES INC;LEI05;US3584351056;10000000
GENERAL STEEL HOLDINGS INC;5493008ZKBIR02ICY091;US3708532029;10000000
GERDAU S.A.;254900YDV6SEQQPZVG24;US3737371050;10000000
GIBRALTAR INDUSTRIES, INC.;LEI08;US3746891072;10000000
GROUP SIMEC SA DE CV;529900LCYCXPA0TZEU09;MXP4984U1083;10000000
HAYNES INTERNATIONAL INC;549300I9MS5UZLRFDO40;US4208772016;10000000
INSTEEL INDUSTRIES INC;52990026LKY4MOX3L174;US45774W1080;10000000
LEGATO MERGER CORP.;5493006RXIB5GVHWJS53;CA0156581070;10000000
MECHEL PAO;253400C9GSPBSKERRP65;US5838406081;10000000
NATIONAL STEEL CO;335800Y6L4X95L2FEF64;INE088B01015;10000000
NIPPON STEEL CORP;35380065QWQ4U2V3PA33;JP3381000003;10000000
NUCOR CORP;549300GGJCRSI2TIEJ46;US6703461052;10000000
OSSEN INNOVATION CO. LTD.;LEI17;US6884102087;10000000
POSCO;988400E5HRVX81AYLM04;KR7005490008;10000000
STEEL DYNAMICS INC;549300HGGKEL4FYTTQ83;US8581191009;10000000
TENARIS SA;549300Y7C05BKC4HZB40;US88031M1099;10000000
TERNIUM S.A.;529900QG4KU23TEI2E46;US8808901081;10000000
TIMKENSTEEL CORP;549300QZTZWHDE9HJL14;US8873991033;10000000
TITAN INTERNATIONAL INC;254900CXRGBE7C4B5A06;US88830M1027;10000000
UNITED STATES STEEL CORP;JNLUVFYJT1OZSIQ24U47;US9129091081;10000000
UNIVERSAL STAINLESS & ALLOY PRODUCTS INC;5493001OEIZDUGXZDE09;US9138371003;10000000
WORTHINGTON INDUSTRIES INC;1WRCIANKYOIK6KYE5E82;US9818111026;10000000
Binary file added examples/data/mdt-steel-demo.xlsx
Binary file not shown.
51 changes: 51 additions & 0 deletions examples/data/rmi-20211120-portfolio.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
company_name;company_lei;company_id;investment_value
AES Corp.;2NUNNB7D43COUIRE5295;US00130H1059;4351252
Algonquin Power & Utilities Corp.;549300K5VIUTJXQL7X75;US0158577090;2228185
"ALLETE, Inc.";549300NNLSIMY6Z8OT86;US0185223007;3829481
Alliant Energy;5493009ML300G373MZ12;US0188021085;3829481
Ameren Corp.;XRZQ5S7HYJFPHJ78L959;US0236081024;15917812
"American Electric Power Co., Inc.";1B4S6S7G0TW5EE83BO58;US0255371017;45520637
"Avangrid, Inc.";549300OX0Q38NLSKPB49;US05351W1036;10049068
Avista Corp.;Q0IK63NITJD6RJ47SW96;US05379B1070;2804211
Cleco Partners LP;5493002H80P81B3HXL31;US18551QAA58;3086052
CMS Energy;549300IA9XFBAGNIBW29;US1258961002;9153135
"Consolidated Edison, Inc.";54930033SBW53OO8T749;US2091151041;20394113
Dominion Energy;ILUL7B6Z54MRYCF6H308;US25746U1097;33528082
DTE Energy;549300IX8SD6XXD71I78;US2333311072;14329945
Duke Energy Corp.;I1BZKREC126H0VB1BL91;US26441C2044;73069652
El Paso Electric Co;OZ8GM8L4AHPKSWZMW205;US283677AZ52;2646941
Emera Inc.;NQZVQT2P5IUF2PGA1Q48;CA2908761018;6631113
Entergy Corp.;4XM3TW50JULSLG8BNC79;US29364G1031;29844269
"Evergy, Inc.";549300PGTHDQY6PSUI61;US30034W1062;18254954
Eversource Energy;SJ7XXD41SQU3ZNWUJ746;US30040W1080;18962480
FirstEnergy Corp.;549300SVYJS666PQJH88;US3379321074;27277340
"Fortis, Inc";549300MQYQ9Y065XPR71;CA3495531079;12428756
MDU Resources Group;0T6SBMK3JTBI1JR36794;US5526901096;1207049
National Grid plc;8R95QZMKZLJX5Q2XR704;US6362744095;12281584
NorthWestern Corp.;3BPWMBHR1R9SHUN7J795;US6680743050;2703150
OG&E Energy;CE5OG6JPOZMDSA0LAQ19;US6708371033;7251242
Otter Tail Corp.;549300HHVBQRQUVKKD91;US6896481032;1264277
Pinnacle West Capital Corp.;TWSEY0NEDUDCKS27AH81;US7234841010;12058547
"PNM Resources, Inc.";5493003JOBJGLZSDDQ28;US69349H1077;3326899
Portland General Electric Co.;GJOUP9M7C39GLSK9R870;US7365088472;5770964
PPL;9N3UAJSNOUXFKQLF3V18;US69351T1060;18146577
Public Service Enterprise Group;PUSS41EMO3E6XXNV3U28;US7445731067;16912134
Sempra Energy;PBBKGKLRK5S5C0Y4T545;US8168511090;29579515
Southern Co.;549300FC3G3YU2FBZD92;US8425871071;50294245
WEC Energy Group;549300IGLYTZUK3PVP70;US92939U1060;11046675
"Xcel Energy, Inc.";LGJNMI9GH8XIDG5RCM61;US98389B1008;27475073
Company AV;LEI01;US6293775085;10000000
Company AW;LEI02;US7134481081;10000000
Company A;LEI03;JP0000000001;10000000
Company B;LEI04;NL0000000002;10000000
Company C;LEI05;IT0000000003;10000000
Company D;LEI06;SE0000000004;10000000
Company E;LEI07;SE0000000005;10000000
Company F;LEI08;NL0000000006;10000000
Company G;LEI09;CN0000000007;10000000
Company H;LEI10;CN0000000008;10000000
Company I;LEI11;CN0000000009;10000000
Company J;LEI12;BR0000000010;10000000
Company K;LEI13;BR0000000011;10000000
Company L;LEI14;BR0000000012;10000000
Company M;LEI15;AR0000000013;10000000
Loading