Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running solve_models() on a pastastore #66

Closed
OnnoEbbens opened this issue Jun 15, 2022 · 4 comments
Closed

Error when running solve_models() on a pastastore #66

OnnoEbbens opened this issue Jun 15, 2022 · 4 comments

Comments

@OnnoEbbens
Copy link
Member

When I run pstore.solve_models() I get this error:

Solving models: 0it [00:00, ?it/s]INFO:pastas.timeseries:Nan-values were removed at the end of the time series B58A0092-004.
INFO:pastas.timeseries:Cannot determine frequency of series B58A0092-004: freq=None. The time series is irregular.
INFO:pastas.timeseries:Time Series B58A0092-004: 13 nan-value(s) was/were found and filled with: drop.
INFO:pastas.timeseries:User provided frequency for time series RH_ELL: freq=D
INFO:pastas.timeseries:User provided frequency for time series EV24_ELL: freq=D
Solving models: 0it [00:00, ?it/s]
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-15-3c39fc9ad072> in <module>
----> 1 pstore.solve_models()

~\anaconda3\envs\dev\lib\site-packages\pastastore\store.py in solve_models(self, mls, report, ignore_solve_errors, store_result, progressbar, **kwargs)
    619         desc = "Solving models"
    620         for ml_name in (tqdm(mls, desc=desc) if progressbar else mls):
--> 621             ml = self.conn.get_models(ml_name)
    622 
    623             m_kwargs = {}

~\anaconda3\envs\dev\lib\site-packages\pastastore\base.py in get_models(self, names, return_dict, progressbar, squeeze, update_ts_settings)
    737         """
    738         models = []
--> 739         names = self._parse_names(names, libname="models")
    740         desc = "Get models"
    741         for n in (tqdm(names, desc=desc) if progressbar else names):

~\anaconda3\envs\dev\lib\site-packages\pastastore\base.py in _parse_names(self, names, libname)
    935                 raise ValueError(f"No library '{libname}'!")
    936         else:
--> 937             raise NotImplementedError(f"Cannot parse 'names': {names}")
    938 
    939     @ staticmethod

NotImplementedError: Cannot parse 'names': Model(oseries=B58A0092-004, name=B58A0092-004, constant=True, noisemodel=True)

I think the error occurs since version 0.7.0 because pstore.conn.models returns a pastastore.base.ModelAccessor now instead of a list.

OnnoEbbens added a commit that referenced this issue Jun 15, 2022
@dbrakenhoff
Copy link
Member

I'm not getting this error... The code above the for loop refers to model_names:

        if mls is None:
            mls = self.conn.model_names
        elif isinstance(mls, ps.Model):
            mls = [mls.name]

Are you sure you're not on an older version?

@OnnoEbbens
Copy link
Member Author

OnnoEbbens commented Jun 15, 2022

I get the error when I run notebook 3 from the hydropandas examples using pastastore version 0.7.0.

https://github.com/ArtesiaWater/hydropandas/blob/master/examples/03_pastastore_from_observations.ipynb

@dbrakenhoff
Copy link
Member

Ah my bad, this was fixed in dev, but not yet in the latest release (0.7.0). I should probably make a new release.

I think you can revert your change and use the dev version.

OnnoEbbens added a commit that referenced this issue Jun 16, 2022
This reverts commit 6fd48dc.
@OnnoEbbens
Copy link
Member Author

Ah yes sorry should have checked that first.

I reverted the changes

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

No branches or pull requests

2 participants