#702 carries a MIKE+ database lookup that places measured timeseries in the network:
_MikePlusStationResolver (~290 lines in obs.py), _observations_from_mikeplus, the db=
and source= arguments on NodeObservation.from_multiple and
ReachObservation.from_multiple, tests/test_mikeplus.py (558 lines), and a section of the
user guide. None of it is needed for the mikeio1d move #702 is about (ADR-013, Phase 2), and
it is not ready to ship on its own terms.
What needs more thought:
- No fixture. Every test builds its own sqlite database with
build_db, so the schema
assumptions are checked only against our own construction of them. Nothing here has been
read against a database MIKE+ wrote.
- The
locationtype codes are magic numbers. _NODE_TYPES = {8, 12},
_LINK_TYPES = {9}. Any other code is dropped and named only on the failure path. No
source says these are the codes, or that they are stable across MIKE+ versions.
resitemname is split on ; and the first field taken. An undocumented encoding.
tsfilename holds a Windows path and is matched on basename alone, case-folded. Two
result files with the same name in different folders collide; source= is the only escape.
- The nine columns across
m_Station and m_Measurement are validated against one
layout. The error says "The database layout is not the one modelskill expects" without
recording which layout that is.
assetname becomes the observation name only when it is unique across the selection.
The names a user gets depend on what else is in the database.
from_multiple(db=...) is public API, so whatever shape lands ships with 1.4.0.
Extract it onto its own branch, off #702 or off main once #702 lands.
#702 carries a MIKE+ database lookup that places measured timeseries in the network:
_MikePlusStationResolver(~290 lines inobs.py),_observations_from_mikeplus, thedb=and
source=arguments onNodeObservation.from_multipleandReachObservation.from_multiple,tests/test_mikeplus.py(558 lines), and a section of theuser guide. None of it is needed for the mikeio1d move #702 is about (ADR-013, Phase 2), and
it is not ready to ship on its own terms.
What needs more thought:
build_db, so the schemaassumptions are checked only against our own construction of them. Nothing here has been
read against a database MIKE+ wrote.
locationtypecodes are magic numbers._NODE_TYPES = {8, 12},_LINK_TYPES = {9}. Any other code is dropped and named only on the failure path. Nosource says these are the codes, or that they are stable across MIKE+ versions.
resitemnameis split on;and the first field taken. An undocumented encoding.tsfilenameholds a Windows path and is matched on basename alone, case-folded. Tworesult files with the same name in different folders collide;
source=is the only escape.m_Stationandm_Measurementare validated against onelayout. The error says "The database layout is not the one modelskill expects" without
recording which layout that is.
assetnamebecomes the observation name only when it is unique across the selection.The names a user gets depend on what else is in the database.
from_multiple(db=...)is public API, so whatever shape lands ships with 1.4.0.Extract it onto its own branch, off #702 or off
mainonce #702 lands.