OMS-NetZero / FAIR

Finite-amplitude Impulse Response simple climate model
https://docs.fairmodel.net
Apache License 2.0
121 stars 61 forks source link

Bugfix in inverse_fair_scm for scalar F_in #109

Closed jamesp closed 1 year ago

jamesp commented 2 years ago

Pull request

Hi OMS-NetZero team,

Very small pull request to fix a bug in inverse_fair_scm. If initialising with a scalar constant F_in the model fails with error: UnboundLocalError: local variable 'F' referenced before assignment.

The test included fails on current master, passes with this change.

Please confirm that this pull request has done the following:

Adding to CHANGELOG.rst

Please add a single line in the changelog notes similar to one of the following:

- (`#XX <http://link-to-pr.com>`_) Added feature which does something
- (`#XX <http://link-to-pr.com>`_) Fixed bug identified in (`#XX <http://link-to-issue.com>`_)
chrisroadmap commented 1 year ago

Hey @jamesp, I'm sorry it's taken 6 months to get around to this. I can't work out why GitHub isn't notifying me of activity on the repo. We're releasing a new version soon but I'll take a quick look at this and merge in if it looks good...

jamesp commented 1 year ago

Thanks @chrisroadmap.

the other code you might be interested in is the (very) light xarray wrapper I wrote around fair.

https://github.com/jamesp/FaIR-Spice/tree/main/src/fair_spice/fair

If you are interested in bringing this up into the fair master repo let me know and I’ll put a pr together.