Closed yugangzhang closed 6 years ago
The immediate problem here is that no Handler has been registered for 'AD_EIGER2'
. I think you know how to fix that --- db.reg.register_handler('AD_EIGER2', EigerHandlerOrWhatever)
. You might be wondering, "Why do I even need Handler for this? I just want the files!" A Resource may correspond to one file or to multiple files (such as a sequence of TIFF files). We rely on the Handler to provide the list of files via the method get_file_list
. You can examples in this file.
So you need to:
'AD_EIGER2'
get_file_list
, which is optional in general but required if you want to use it in this way.Did (1), worked fine, got stuck with (2):
In [13]: sud = get_sid_filenames(db_chx[uid])
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-13-f7a48aa637dc> in <module>()
----> 1 sud = get_sid_filenames(db_chx[uid])
<ipython-input-7-5e676201252f> in get_sid_filenames(header)
29 datum_kwarg_gen = (datum['datum_kwargs'] for datum in
30 datum_gen)
---> 31 filepaths.extend(db.reg.get_file_list(uid, datum_kwarg_gen))
32 return header.start['scan_id'], header.start['uid'], filepaths
/opt/conda_envs/analysis-2018-1.0/lib/python3.6/site-packages/databroker/assets/base_registry.py in get_file_list(self, resource_or_uid, datum_kwarg_gen)
277 actual_resource = self.resource_given_uid(resource_or_uid)
278 return self._api.get_file_list(actual_resource, datum_kwarg_gen,
--> 279 self.get_spec_handler)
280
281 def get_history(self, resource_uid):
/opt/conda_envs/analysis-2018-1.0/lib/python3.6/site-packages/databroker/assets/core.py in get_file_list(resource, datum_kwarg_gen, get_spec_handler)
287 """
288 handler = get_spec_handler(resource['uid'])
--> 289 return handler.get_file_list(datum_kwarg_gen)
AttributeError: 'EigerHandler' object has no attribute 'get_file_list'
@danielballan, @jrmlhermitte, what would you suggest?
file handler needs get_file_list
, ill add it now. i suspect this was part of pyCHX
which I think defined its own handler with get_file_list
. iwlll respond soon....
@yugangzhang please let's test this tomorrow maybe? https://github.com/NSLS-II-CHX/eiger-io/pull/13
work on my machine, good night!
Thanks! Will try tomorrow.
Function:
Usage:
Error message: