prjemian / punx

Python Utilities for NeXus HDF5 files
https://prjemian.github.io/punx
5 stars 7 forks source link

API terminology is confusing #166

Open prjemian opened 2 years ago

prjemian commented 2 years ago

Many terms in the API are confusing, such as the difference (in the nxdl_manager module) between the attributes and xml_attributes dictionaries. The source code could be named and organized so the different features are more recognizable to the programmer. One idea is to re-organize into submodules, similar to the subcommands of the user interface:

    configuration       show configuration details of punx
    demonstrate         demonstrate HDF5 file validation
    structure           structure command deprecated. Use ``tree`` instead
    tree                show tree structure of HDF5 or NXDL file
    update              update the local cache of NeXus definitions
    validate            validate a NeXus file
prjemian commented 2 years ago

What, exactly, should this dictionary contain and how will it be used? https://github.com/prjemian/punx/blob/f0e707d1545e75b8aa5184334454849f03e24d38/punx/nxdl_manager.py#L152

Consider renaming self.xml_attributes to self.configuration.

This Python structure should contain content that was described in the NXDL XML file but only provide it in a way that will be useful within punx.

How is self.xml_attributes different from self.attributes? Here: https://github.com/prjemian/punx/blob/f0e707d1545e75b8aa5184334454849f03e24d38/punx/nxdl_manager.py#L291

prjemian commented 2 years ago

The NXDL__attribute class says: https://github.com/prjemian/punx/blob/f0e707d1545e75b8aa5184334454849f03e24d38/punx/nxdl_manager.py#L366