nexusformat / features

Work on NeXus features and recipes by the NIAC and friends
0 stars 6 forks source link

Add draft RIXS example #27

Closed PeterC-DLS closed 7 years ago

zjttoefs commented 7 years ago

According to travis the file does not pass the feature test.

markbasham commented 7 years ago

Just to clarify

=== examples/draft_fake_rixs.nxs ===
Entry "definition" appears to contain the following features (they validate correctly): 
    The following features failed to validate:
        NXrixs (000000005A403F80) is invalid with the following errors:
            No detectors found with any required fields
Entry "entry" appears to contain the following features (they validate correctly): 
    The following features failed to validate:
        NXrixs (000000005A403F80) is invalid with the following errors:
            No detectors found with any required fields
PeterC-DLS commented 7 years ago

Strange! I get:

$ python src/nxfeature.py -f 000000005A403F80 examples/draft_fake_rixs.nxs 
Entry "definition" appears to contain the following features (they validate correctly): 
    NXrixs (1514160000) {u'entry/andor': ['photoelectrons_energy', 'detector_sensitivity', 'energy_direction', 'energy_dispersion']}

Entry "entry" appears to contain the following features (they validate correctly): 
    NXrixs (1514160000) {u'entry/andor': ['photoelectrons_energy', 'detector_sensitivity', 'energy_direction', 'energy_dispersion']}
markbasham commented 7 years ago

Im getting a simmilar problem at the moment, so i will merge the request and try to fix both.

matthew-d-jones commented 7 years ago

I get the same result as Travis for this branch.

markbasham commented 7 years ago

Think its a Python3 issue, pete is investigating

matthew-d-jones commented 7 years ago

Yes, line 13 should be:

if str(obj.attrs["NX_class"], 'utf8') in nx_class:
PeterC-DLS commented 7 years ago

Is it better to use the six package then six.u(obj.attrs["NX_class"]) works in both python 2 and 3?

matthew-d-jones commented 7 years ago

At the meeting no one seemed to care too much about Python 2 anymore. There may be some incompatibility with exception handling for Python 2 now as well.

PeterC-DLS commented 7 years ago

Got a more neutral fix now