Summary
The NMAMinorTraceChemistry.volume field uses Float but the source database (NM_Aquifer_Dev_DB) defines it as int. This should be changed to Integer for consistency with the source schema.
Details
File: db/nma_legacy.py:378
Current:
volume: Mapped[Optional[float]] = mapped_column(Float)
Should be:
volume: Mapped[Optional[int]] = mapped_column(Integer)
Context
- Source database schema (
AMPAPI/testing_db/create_tables.sql) defines Volume int default 0
- All actual data values in the source CSV are integers (0, NULL, or whole numbers like 730, 420, 200)
NMARadionuclides already correctly uses Integer for volume
- This change ensures consistency between both chemistry models and the source database
Implementation
Branch: fix/minor-trace-volume-int
Changes required:
Summary
The
NMAMinorTraceChemistry.volumefield usesFloatbut the source database (NM_Aquifer_Dev_DB) defines it asint. This should be changed toIntegerfor consistency with the source schema.Details
File:
db/nma_legacy.py:378Current:
Should be:
Context
AMPAPI/testing_db/create_tables.sql) definesVolume int default 0NMARadionuclidesalready correctly usesIntegerfor volumeImplementation
Branch:
fix/minor-trace-volume-intChanges required:
db/nma_legacy.py_safe_int()intransfers/minor_trace_chemistry_transfer.pytests/test_nma_chemistry_lineage.py