Closed pedrocamargo closed 2 years ago
Are you following a code model somewhere in the docs, can you point me there? What version of sharrow is installed?
On Aug 25, 2022, at 5:37 PM, Pedro Camargo @.***> wrote:
Indexing skims on arbitrary IDs returns an error
skims = larch.OMX(omx_file, mode='r' ) lx.Dataset.construct.from_omx(skims, indexes='taz')
Results in
`--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Input In [58], in <cell line: 1>() ----> 1 lx.Dataset.construct.from_omx(skims, indexes='taz')
File D:\src\OuterLoop\gsm-poc.venv\lib\site-packages\larch\dataset\construct.py:14, in _steal..wrapper(*args, kwargs) 13 def wrapper(*args, *kwargs): ---> 14 return func(args, kwargs)
File D:\src\OuterLoop\gsm-poc.venv\lib\site-packages\sharrow\dataset.py:235, in from_omx(omx, index_names, indexes, renames) 228 indexes = { 229 index_names[0]: zero_based(omx_shape[0]), 230 index_names[1]: zero_based(omx_shape[1]), 231 } 232 if indexes is not None: 233 d["coords"] = { 234 index_name: {"dims": index_name, "data": index} --> 235 for index_name, index in indexes.items() 236 } 237 return xr.Dataset.from_dict(d)
AttributeError: 'str' object has no attribute 'items'`
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
Should be fixed now if you update sharrow to 2.2.4.
Indexing skims on arbitrary IDs returns an error
skims = larch.OMX(omx_file, mode='r' ) lx.Dataset.construct.from_omx(skims, indexes='taz')
Results in
AttributeError Traceback (most recent call last) Input In [58], in <cell line: 1>() ----> 1 lx.Dataset.construct.from_omx(skims, indexes='taz')
File D:\src\OuterLoop\gsm-poc.venv\lib\site-packages\larch\dataset\construct.py:14, in _steal..wrapper(*args, kwargs)
13 def wrapper(*args, *kwargs):
---> 14 return func(args, kwargs)
File D:\src\OuterLoop\gsm-poc.venv\lib\site-packages\sharrow\dataset.py:235, in from_omx(omx, index_names, indexes, renames) 228 indexes = { 229 index_names[0]: zero_based(omx_shape[0]), 230 index_names[1]: zero_based(omx_shape[1]), 231 } 232 if indexes is not None: 233 d["coords"] = { 234 index_name: {"dims": index_name, "data": index} --> 235 for index_name, index in indexes.items() 236 } 237 return xr.Dataset.from_dict(d)
AttributeError: 'str' object has no attribute 'items'