idaholab / MontePy

MontePy is the most user friendly Python library (API) to read, edit, and write MCNP input files.
https://www.montepy.org/
MIT License
32 stars 6 forks source link

Create group owner collections: e.g., Cells #61

Closed MicahGale closed 9 months ago

MicahGale commented 2 years ago

The idea is that many convenience functions are needed when handling problems objects (e.g., a Cell). See: #11, #10, #19, #9, and expected failures in !11.

I propose that the be a Cells object that owns and manages the collection of cells. Proposed features:

  1. Implements __getitem__ to allow accessing the list like a dictionary by cell number.
  2. Implementing append to enforce object types, avoiding number collisions, etc.
  3. Providing a cell_numbers generator that allows users to quickly check if a cell number is in use without the possibility of stale data.
  4. Handling Cell-data cards and handling the switching of data cards to cell parameters. It will also store whether or not those data are on the cell or data cards.
  5. Allow quick renumbering given an iter instance.
  6. Surfaces should provide a lot of convenience functions to get all CZ surfaces, and find the smallest radius, etc.

This really is the central component to release-0.0.5

MicahGale commented 2 years ago

marked this issue as related to #11

MicahGale commented 2 years ago

marked this issue as related to #10

MicahGale commented 2 years ago

marked this issue as related to #19

MicahGale commented 2 years ago

marked this issue as related to #9

MicahGale commented 2 years ago

Items 4, and 5 are outside the scope of !13.

MicahGale commented 2 years ago

mentioned in commit 06952dcad656b9275e46d12c85ade88a480d06b7