prjemian / punx

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

additional tests for nxdl manager #163

Closed prjemian closed 2 years ago

prjemian commented 2 years ago

Provide basic tests for NXDL_Manager that shows its structure.

This is the list of tests to be added:

prjemian commented 2 years ago

Note that all NXDL files tested do not have any link specifications within the NXentry group. There are links specified in some NXDL files (such as NXsas) within the NXdata group.

prjemian commented 2 years ago

The reason that maxOccurs in all test cases is that it is set in the nxdl_manager.py code: https://github.com/prjemian/punx/blob/f0e707d1545e75b8aa5184334454849f03e24d38/punx/nxdl_manager.py#L317

Was expecting this in base classes to be set to "unbounded". Investigate separately.

prjemian commented 2 years ago

NXcontainer has a link: https://github.com/prjemian/punx/blob/f0e707d1545e75b8aa5184334454849f03e24d38/punx/cache/a4fd52d/contributed_definitions/NXcontainer.nxdl.xml#L160

prjemian commented 2 years ago

Add similar tests for other classes in nxdl_manager module.

prjemian commented 2 years ago

Side note: At this point (HEAD: 9b653a5) the run time of pytest from the project's root takes much (~3x) longer on Windows 10 than Linux. Same environment installation (bluesky_2022_1). Why?

time, s # tests OS hardware details
149.3 152 Win 10 CPU: Dual Core Intel Core i7-1065G7 (-MCP-) speed: 1498 MHz
58.75 152 Linux Mint 20 (guest VM on above) CPU: Dual Core Intel Core i7-1065G7 (-MCP-) speed: 1498 MHz
48.5 152 Linux Mint 20.1 CPU: Quad Core Intel Core i5-7600 (-MCP-) speed/min/max: 910/800/4100

Observe that it's not just a difference in the CPU speed.

prjemian commented 2 years ago

@carterbox Basic tests added. Also some detailed tests added. There could always be more. Work on this issue has provoked TODO and FIXME comments that, each, need to create a new issue for attention.

prjemian commented 2 years ago

(This PR is ready for review.)

prjemian commented 2 years ago

All FIXME comments have associated issues now. Issues for some TODO comments must be created.

prjemian commented 2 years ago

@carterbox Are there any changes to be made here?

prjemian commented 2 years ago

@carterbox Thanks!