Skip to content

Draft: Resolve "Create CLI tool for sample assembly creator"

Blocked: should be merged in after !1 (merged)

Summary of Changes

Work includes:

  • Adds cyclopts as CLI dependency (removes typer)
  • Adds dataclasses for geometries (cylinder and hollow cylinder)
  • Adds dataclasses for materials (base class that supports input types of S(Q) files, S(Q,E) files, and predefined materials)
  • Adds dataclasses for predefined scatterers (PAC06 can)
  • Adds scatterer dataclasses that is a composition of geometry + material
  • Adds CLI to support adding list of scatterers

Manual testing:

  • I run the following to build the container and test CLI:
docker build -t sample-assembly .
docker run sample-assembly mcu_sample_assembly --add-cylinder 2.0 3.0 'sofq-file' /path --add-hollow-cylinder 4. 5. 6. 'sofqe-file' /path2 --add-pac06
  • Output:
CylinderScatterer(geometry=Cylinder(radius=2.0, height=3.0), material=Material(input_type='sofq-file', value='/path'))
HollowCylinderScatterer(geometry=HollowCylinder(inner_radius=4.0, outer_radius=5.0, height=6.0), material=Material(input_type='sofqe-file', value='/path2'))
HollowCylinderScatterer(geometry=HollowCylinder(inner_radius=6.0, outer_radius=6.1, height=10.0), material=Material(input_type='predefined', value='vanadium'))

Checklist

  • The MR has a clear and concise title
  • Code is self-documented and follows style guidelines.
  • Automated tests are written and pass successfully.
  • Regression tests (e.g. manually triggered system tests, manual GUI/tool tests, ...) are performed to make sure the MR does not break anything (when applicable)
  • Readme file is present and up-to-date.

Documentation Updates

N/A

Additional Notes

N/A

Closes #4

Edited by McDonnell, Marshall

Merge request reports

Loading