Skip to content

Ms/awe function#418

Merged
manuelsalslz merged 4 commits into
mainfrom
ms/awe_function
May 5, 2025
Merged

Ms/awe function#418
manuelsalslz merged 4 commits into
mainfrom
ms/awe_function

Conversation

@manuelsalslz
Copy link
Copy Markdown
Contributor

@manuelsalslz manuelsalslz commented May 5, 2025

Solves #404 (onstove.OnStove.income_estimation()) and starting to address issue #414 (onstove.technology.affordability_categories()). Regarding this second issue, open points are:

  • How to call it within onstove.OnStove.run()?
  • Momentarily tested by calling in the Jupyter notebook after model.run():

for tech in country.techs: try: country.techs[tech].affordability_categories(country, income_data = True) except KeyError: continue
Implementation works, yet it shows the following warning in each tech: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.
For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.

  • Finally, how to implement this last method for the maximimum benefit technology?

Copy link
Copy Markdown
Contributor

@camiloramirezgo camiloramirezgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the input for the self.run we discussed: affordability_categories.

Comment thread onstove/model.py Outdated
Comment thread onstove/model.py Outdated
Comment thread onstove/model.py Outdated
Comment thread onstove/model.py
@manuelsalslz
Copy link
Copy Markdown
Contributor Author

Latest commit solves #404 and solves #414. Open point: implementation of the method for the maximum net benefit technology.

@manuelsalslz
Copy link
Copy Markdown
Contributor Author

Correct declaration of self.income_data in model.py and incorporation of income_estimation to test_model_run.py

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2025

Codecov Report

Attention: Patch coverage is 85.07463% with 10 lines in your changes missing coverage. Please review.

Project coverage is 72.06%. Comparing base (2748a11) to head (7993add).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
onstove/model.py 81.08% 7 Missing ⚠️
onstove/technology.py 89.65% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   73.30%   72.06%   -1.25%     
==========================================
  Files          17       17              
  Lines        3372     3411      +39     
==========================================
- Hits         2472     2458      -14     
- Misses        900      953      +53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@manuelsalslz manuelsalslz merged commit 835420d into main May 5, 2025
2 of 3 checks passed
@manuelsalslz manuelsalslz deleted the ms/awe_function branch May 5, 2025 14:24
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