-
Notifications
You must be signed in to change notification settings - Fork 102
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
Miss-alignment in tpl indices and original file #507
Comments
Update, I'm even more confused, shocking I know. Suspecting the
Next step, made the index an int, same issue. I doubt I could misunderstand what is going on more! They look aligned to me. I think the only thing left is the sep?
|
Got it to work without any |
Seems there is a few things here @wkitlasten. -1 shifting mfile_skip use_rows misalignment |
Thanks for that. The main issue was the use_rows = [(1,)...] bit and inadvertantly mixing positional with label indexes (which confounded the first two). I read the hints in the docs but it just wouldn't penetrate my thick skull. Not that it makes any more sense that what is written, but perhaps a more explicit explanation could be added to the docstring? Something like: "For use_rows with a single 'index_cols' use [('a',),('b',),('c',)] to set parameters for |
This issue arises from line 2099 of utils.helpers() when index names have Probably a more explicit check for non-numeric parts of the index (that are not |
Hey,
Can you point me to a simple example that uses
par_type="constant"
anduse_rows=[list-o-lines]
within pf.add_parameters() so I can break it?! A bit below, but I will spare anyone else the pain of looking at the rest of my mess!I am using this to parameterize all lines in some files and it seems to work mostly as expected:
The file formerly known as fname (.csv):
If I leave
mfile_skip=1
out it tries to parameterize the header (e.g.,parnme = pname:sfr.inflow_inst:0_ptype:gr_usecol:2_pstyle:m_idx0:ifno
which is obviously wrong!If I have
mfile_skip=1
in the callifno
is shifted by -1 from the original model input file (e.g.parnme = pname:sfr.inflow_inst:1_ptype:gr_usecol:2_pstyle:m_idx0:0
). If I leavemfile_skip
out of the call and use index labels rather than locations for use_cols and index_cols I get a similar result (ifno shifted -1). I don't understand this, but maybe that is okay, it ain't the first time. That produces the following .tpl file.I do something similar for other files, but with a subset of lines. It seems the use_rows arg requires positional indexing, hence I use positional for use_cols and index_cols too and require the mfile_skip=1 to avoid parameterizing the header:
That builds the following .tpl file, from the original file which is as expected.
Pest builds fine from pst_from with the above bits. But when I try to
pyemu.helpers.apply_list_and_array_pars(arr_par_file='mult2model_info.csv')
I get the following error related to the 2ndadd_parameters
call:From line 2213 in helpers.py
So clearly the issue is in
common_idx = (new_df.index.intersection(mlts.index).drop_duplicates())
but I can't track how mlts gets its index or how I can adjust my pf builds to ensure it lines up with "new_df".Any suggestions would be helpful.
The text was updated successfully, but these errors were encountered: