I am testing with a UCI that lacks both SCHEMATIC & NETWORK (it is from a version of the Chesapeake Bay model land simulation which simply routes output to a UCI via EXT TARGETS block to be later run in a separate river-only UCI). This fails on uci import when calling the panda function concat since both net and sc remain as None. I can get the UCI import to complete by testing for if not ( (net is None) and (sc is None) ): before running the linkage output to the hdf, but wondering if anyone sees a problem with this before I go forward with forking and adding a pull request to the new code.
linkage = concat((net, sc), ignore_index=True, sort=True)
for cname in colnames:
if cname not in linkage.columns:
linkage[cname] = ''
linkage = linkage.sort_values(by=['TVOLNO']).replace('na','')
linkage.to_hdf(store, '/CONTROL/LINKS', data_columns=True)
For this:
if not ( (net is None) and (sc is None) ):
linkage = concat((net, sc), ignore_index=True, sort=True)
for cname in colnames:
if cname not in linkage.columns:
linkage[cname] = ''
linkage = linkage.sort_values(by=['TVOLNO']).replace('na','')
linkage.to_hdf(store, '/CONTROL/LINKS', data_columns=True)
And so, in sum, no /CONTROL/LINKS gets written to the hd5.
Hi @rburghol , that seems like an appropriate solution. It's good to have additional testers to find things like this that don't show up in our standard tests!
I am testing with a UCI that lacks both SCHEMATIC & NETWORK (it is from a version of the Chesapeake Bay model land simulation which simply routes output to a UCI via
EXT TARGETS
block to be later run in a separate river-only UCI). This fails on uci import when calling the panda functionconcat
since bothnet
andsc
remain asNone
. I can get the UCI import to complete by testing forif not ( (net is None) and (sc is None) ):
before running the linkage output to the hdf, but wondering if anyone sees a problem with this before I go forward with forking and adding a pull request to the new code.Basically, I swap out the original (near line 160 in readUCI.py):
For this:
And so, in sum, no
/CONTROL/LINKS
gets written to the hd5.