Is your feature request related to a problem? Please describe.
I'm always frustrated when...
appending an object created from scratch (that does not have a number assigned yet) to a NumberedObjectCollection.
If no number is assigned, it results in the following error:
Traceback (most recent call last):
File "./prototype.py", line 156, in <module>
main()
~~~~^^
File "./prototype.py", line 151, in main
something(deck, pos=f1)
~~~~~~~~~^^^^^^^^^^^^^^
File "./prototype.py", line 131, in something
deck.cells.append_renumber(cell)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "./montepy/numbered_object_collection.py", line 613, in append_renumber
number = obj.number if obj.number > 0 else 1
^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Describe the solution you'd like
When obj.number is None, then NumberedObjectCollection.append_renumber() should just assign the next available number.
Describe alternatives you've considered
None
Is your feature request related to a problem? Please describe.
I'm always frustrated when...
appending an object created from scratch (that does not have a number assigned yet) to a
NumberedObjectCollection.If no number is assigned, it results in the following error:
Describe the solution you'd like
When
obj.number is None, thenNumberedObjectCollection.append_renumber()should just assign the next available number.Describe alternatives you've considered
None