OMS-NetZero / FAIR

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

Speed up scmdf conversion #78

Closed znicholls closed 4 years ago

znicholls commented 4 years ago

Pull request

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>`_)
znicholls commented 4 years ago

@chrisroadmap not perfect but a start

znicholls commented 4 years ago

you could make it faster again if you were more opinionated about the units coming in (and forced users to interpolate before they started)

chrisroadmap commented 4 years ago

Tests pass with scmdata 0.5.2 but fail for me with scmdata 0.4.3 and 0.5.0:

What's the minimum requirement? 0.5.2?

tests/integration/test_scmdf.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fair/tools/scmdf.py:205: in scmdf_to_emissions
    hist_df = ssp245_world_emms_holder.values_fair_units.filter(
fair/tools/scmdf.py:45: in values_fair_units
    ssp_df_hist = self.values
fair/tools/scmdf.py:32: in values
    lowercase_cols=True
/nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:375: in __init__
    self._init_timeseries(data, index, columns, **kwargs)
/nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:405: in _init_timeseries
    (_df, _meta) = _read_file(data, **kwargs)
/nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:67: in _read_file
    return _format_data(_read_pandas(fnames, *args, **kwargs))

...

>           df = pd.read_csv(fname, *args, **kwargs)
E           TypeError: parser_f() got an unexpected keyword argument 'lowercase_cols'

/nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:98: TypeError
znicholls commented 4 years ago

Yep 0.5.2 I guess

On Fri, 10 Jul 2020 at 8:13 pm, chrisroadmap notifications@github.com wrote:

Tests pass with scmdata 0.5.2 but fail for me with scmdata 0.4.3 and 0.5.0:

What's the minimum requirement? 0.5.2?

tests/integration/test_scmdf.py:51:


fair/tools/scmdf.py:205: in scmdf_to_emissions hist_df = ssp245_world_emms_holder.values_fair_units.filter( fair/tools/scmdf.py:45: in values_fair_units ssp_df_hist = self.values fair/tools/scmdf.py:32: in values lowercase_cols=True /nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:375: in init self._init_timeseries(data, index, columns, kwargs) /nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:405: in _init_timeseries (_df, _meta) = _read_file(data, kwargs) /nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:67: in _read_file return _format_data(_read_pandas(fnames, *args, **kwargs))

...

      df = pd.read_csv(fname, *args, **kwargs)

E TypeError: parser_f() got an unexpected keyword argument 'lowercase_cols'

/nfs/b0110/Users/mencsm/miniconda3/envs/fair-dev/lib/python3.7/site-packages/scmdata/run.py:98: TypeError

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OMS-NetZero/FAIR/pull/78#issuecomment-656599476, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFUH5G25MI3U2TORUFZZHSDR23SWFANCNFSM4OWIRIYA .