[BDMS-264] Expand transfer seeder#227
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. |
Comment on lines
+13
to
+25
| # Core models | ||
| from db.contact import Contact | ||
| from db.location import Location | ||
| from db.thing import Thing | ||
| from db.sensor import Sensor | ||
| from db.deployment import Deployment | ||
| from db.sample import Sample | ||
| from db.observation import Observation | ||
| from db.parameter import Parameter | ||
| from db.analysis_method import AnalysisMethod | ||
| from db.regulatory_limit import RegulatoryLimit | ||
| from db.transducer import TransducerObservation | ||
| from db.status_history import StatusHistory |
Contributor
There was a problem hiding this comment.
All of the models are imported into db/__init__.py. To make access to them simpler you could do from db import * (I think). That way we won't have to keep track of them in multiple places.
Comment on lines
+66
to
+75
| # 3. Parameters & Methods | ||
| param_names = ["pH", "Temperature", "Conductivity", "TDS", "DO"] | ||
| for p in param_names: | ||
| prm = Parameter( | ||
| parameter_name=p, | ||
| matrix="Water", | ||
| default_unit="pH units" if p == "pH" else "mg/L", | ||
| ) | ||
| s.add(prm) | ||
| parameters.append(prm) |
Contributor
There was a problem hiding this comment.
This isn't needed if MODE=development since setting that environment variable initializes both the parameter and lexicon tables. See core/appy.py
Comment on lines
+105
to
+107
| t.location_associations = [] # placeholder if ORM auto-handles | ||
| t.locations.append(loc) | ||
| things.append(t) |
Contributor
There was a problem hiding this comment.
it would be good to associate contacts with things, too, via the ThingContactAssociation model
jirhiker
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR addresses the following problem/context:
How
Implementation summary - the following was changed/added/removed:
Notes
Any special considerations, workarounds, or follow-up work to note?