Skip to content

Commit

Permalink
Fix cge core and joplin basevals (#628)
Browse files Browse the repository at this point in the history
* add mlenabledcgejoplin

* add mlenabled cge joplin

* finalize pr

* update coefficients

* fix basevals and core cge bug

* add changelog entry
  • Loading branch information
Rashmil-1999 authored Oct 31, 2024
1 parent a51ce64 commit 77ed41b
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 115 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed
- CoreCGEML bug and updated base values [#627](https://github.com/IN-CORE/pyincore/issues/627)


## [1.20.0] - 2024-10-24

Expand Down
18 changes: 6 additions & 12 deletions pyincore/analyses/core_cge_ml/corecgeml.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ def construct_output(self, predictions: dict) -> Dict[str, Dict[str, list]]:

temp_prefd: Dict[str, Dict[str, float]] = defaultdict(dict)
temp_postfd: Dict[str, Dict[str, float]] = defaultdict(dict)

for i, fd_sector in enumerate(self.sectors["dffd"]):
splits = fd_sector.split("_")
if len(splits) > 2:
sector = "_".join(splits[:-1])
grp = splits[-1]

sector = "_".join(splits[:-1]) if len(splits) > 1 else splits[0]
grp = splits[-1]

temp_prefd[sector][grp] = predictions["dffd"]["before"][i]
temp_postfd[sector][grp] = predictions["dffd"]["after"][i]
Expand All @@ -116,15 +117,8 @@ def construct_output(self, predictions: dict) -> Dict[str, Dict[str, list]]:
prefd_l = []
postfd_l = []
for grp in self.labor_groups:
if temp_prefd[sector].get(grp, None) is None:
prefd_l.append(-1)
else:
prefd_l.append(temp_prefd[sector][grp])

if temp_postfd[sector].get(grp, None) is None:
postfd_l.append(-1)
else:
postfd_l.append(temp_postfd[sector][grp])
prefd_l.append(temp_prefd[sector].get(grp, -1))
postfd_l.append(temp_postfd[sector].get(grp, -1))

prefd[sector] = prefd_l
postfd[sector] = postfd_l
Expand Down
Loading

0 comments on commit 77ed41b

Please sign in to comment.