Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
7d97f47
feat: Create new `Notes` table
ksmuczynski Oct 17, 2025
8ab40ff
doc: Updated `Notes` model docstring for clarity.
ksmuczynski Oct 20, 2025
7aff37d
feat: Add 'notable_type' category and values
ksmuczynski Oct 20, 2025
1c9db25
doc: Remove TODO comments
ksmuczynski Oct 20, 2025
8936e1a
feat: Add polymorphic NotesMixin to support multi-category notes
ksmuczynski Oct 20, 2025
d0a7b40
feat: Integrate NotesMixin into Location and Thing models
ksmuczynski Oct 20, 2025
c905273
feat: Add Notes schema and polymorphic relationships to Thing and Loc…
ksmuczynski Oct 22, 2025
550acce
fix: Resolve circular import in Notes model
ksmuczynski Oct 22, 2025
f18b715
fix: Resolve undefined pk_value in NotesMixin.add_note method
ksmuczynski Oct 22, 2025
6425d06
refactor: Update 'noteable_type' category to `note_type`
ksmuczynski Oct 22, 2025
e814635
fix: Standardize location notes as List[NoteResponse] across schemas
ksmuczynski Oct 22, 2025
3f37302
WIP: implement well core information feature tests
jacob-a-brown Nov 4, 2025
deee08a
WIP: add well purposes to feature testing data
jacob-a-brown Nov 4, 2025
7fdf2df
WIP: well core information behave test development
jacob-a-brown Nov 4, 2025
54abcab
WIP: id link testing
jacob-a-brown Nov 4, 2025
819f7ce
WIP: well core information behave test
jacob-a-brown Nov 4, 2025
8dd71e3
Merge branch 'bdms-221' into bdms-221-jab-bdms-223
jacob-a-brown Nov 4, 2025
b777dc5
WIP: erase and rebuild db each time
jacob-a-brown Nov 4, 2025
fe10338
Merge branch 'bdms-221' into bdms-221-jab-bdms-223
jacob-a-brown Nov 4, 2025
1486fd9
feat: note reused statements and places for fixtures
jacob-a-brown Nov 4, 2025
c2df7af
WIP: note taking for well core information
jacob-a-brown Nov 4, 2025
9a7a77b
fix: enhance error logging in sensor_transfer.py for better debugging
jirhiker Nov 5, 2025
e8c9442
refactor: address PR comments
jacob-a-brown Nov 5, 2025
6ee0719
refactor: update behave tests per PR feedback
jacob-a-brown Nov 5, 2025
5e3a106
refactor: update feature tests per PR feedback
jacob-a-brown Nov 5, 2025
62fed51
Merge branch 'staging' into bdms-221-jab-bdms-223
jacob-a-brown Nov 6, 2025
c504b27
refactor: revert to context.response for the single request
jacob-a-brown Nov 6, 2025
217c9fe
Merge branch 'staging' into bdms-221-jab-bdms-223
jacob-a-brown Nov 6, 2025
995d6b1
refactor: use context objects to get well id for get request
jacob-a-brown Nov 6, 2025
d505856
feat: add transducer observation handling and improve database initia…
jirhiker Nov 6, 2025
679f57c
fix: improve assertion messages for transducer data validation
jirhiker Nov 6, 2025
87dba2b
feat: update tests
jacob-a-brown Nov 6, 2025
077dacd
feat: add id links to pseudo fixtures
jacob-a-brown Nov 6, 2025
0cdc9e4
Update transducer.py
jirhiker Nov 6, 2025
27fb338
Formatting changes
jirhiker Nov 6, 2025
00ad18b
fix: enhance data validation and improve well observation retrieval i…
jirhiker Nov 6, 2025
52c27bf
Formatting changes
jirhiker Nov 6, 2025
2ce6f5c
refactor: update groups in testing data
jacob-a-brown Nov 7, 2025
8f1ff33
Merge pull request #230 from DataIntegrationGroup/bdms-221-jab-bdms-223
jacob-a-brown Nov 7, 2025
94a6dae
feat: update group model and expand lexicon
ksmuczynski Nov 7, 2025
4bdda8e
Merge branch 'bdms-221' into kas-bdms-221-225-core-well-info-models-s…
ksmuczynski Nov 7, 2025
a997e10
refactor: update well core feature test implementation
jacob-a-brown Nov 7, 2025
9858ec2
refactor: update lexicon category names and terms associated with the…
ksmuczynski Nov 7, 2025
19c2904
refactor: list status_type terms in proper case.
ksmuczynski Nov 7, 2025
2e6eb67
fix: replace init_db with erase_and_rebuild_db and update transducer …
jirhiker Nov 7, 2025
35c7649
fix: update BDD test workflow to include production tag
jirhiker Nov 7, 2025
20e39e2
refactor: update lexicon
ksmuczynski Nov 7, 2025
8648d01
fix: update BDD test workflow to use combined tags for backend and pr…
jirhiker Nov 7, 2025
b0863cd
fix: add PostgreSQL environment variables for BDD test execution
jirhiker Nov 7, 2025
b9bb73e
feat: add endpoint for retrieving transducer groundwater level observ…
jirhiker Nov 7, 2025
c0fa001
fix: remove deprecated transducer groundwater level endpoint and upda…
jirhiker Nov 8, 2025
8cb670e
Merge branch 'staging' into jir-fix-transducer
jirhiker Nov 10, 2025
6229d22
fix: remove commented-out SpatiaLite installation and related environ…
jirhiker Nov 10, 2025
39e7b60
fix: remove commented-out PostGIS images from tests.yml
jirhiker Nov 10, 2025
f11e2cb
fix: uncomment PostGIS image version and clean up test run commands i…
jirhiker Nov 10, 2025
0d38d28
Merge branch 'staging' into bdms-221
jacob-a-brown Nov 10, 2025
dc23839
refactor: update `Group` model
ksmuczynski Nov 10, 2025
7613648
Merge pull request #239 from DataIntegrationGroup/kas-bdms-221-225-co…
ksmuczynski Nov 10, 2025
84edffc
Merge branch 'bdms-221' of https://github.com/DataIntegrationGroup/NM…
jacob-a-brown Nov 10, 2025
d1a4b34
fix: import lexicon from db
jacob-a-brown Nov 10, 2025
84a2817
feat: make GroupType and MonitoringFrequency enums
jacob-a-brown Nov 10, 2025
d8f69c6
feat: update GroupResponse and add to ThingResponse
jacob-a-brown Nov 10, 2025
81d960f
refactor: update bdd tests for updated group
jacob-a-brown Nov 10, 2025
d22f0da
feat: implement well purposes in behave tests
jacob-a-brown Nov 10, 2025
31c7070
refactor: make status_type and status_value lexicon terms
jacob-a-brown Nov 10, 2025
1000991
Merge branch 'staging' into jir-kas-notes-model
jirhiker Nov 10, 2025
ba002e2
feat: add monitoring statuses to lexicon
jacob-a-brown Nov 10, 2025
eb5de1e
feat: add well status to thing
jacob-a-brown Nov 10, 2025
33e478e
feat: function to convert m to ft
jacob-a-brown Nov 10, 2025
dc33da4
feat: pass test for well status
jacob-a-brown Nov 10, 2025
f7c0ffb
feat: pass monitoring frequency bdd test
jacob-a-brown Nov 10, 2025
c3018cc
feat: implement monitoring status
jacob-a-brown Nov 10, 2025
9185229
refactor: remove outdated note
jacob-a-brown Nov 10, 2025
3267246
feat: enhance note management by adding release status and updating n…
jirhiker Nov 10, 2025
fc31bc8
fix: update note handling in CRUD operations to ensure session commit…
jirhiker Nov 10, 2025
e7636dd
refactor: return GeoJSON for current_location
jacob-a-brown Nov 11, 2025
bdeb210
fix: transform wkb to wkt for tests
jacob-a-brown Nov 11, 2025
79e73d5
fix: transform wkb to wkt for tests
jacob-a-brown Nov 11, 2025
505a64e
notes: remove outdated TODO
jacob-a-brown Nov 11, 2025
12998f8
feat: add alternate ids to ThingResponse
jacob-a-brown Nov 11, 2025
85f1c75
Merge branch 'staging' into bdms-221
jacob-a-brown Nov 11, 2025
a74168f
refactor: use Organiation enum for alternate organization
jacob-a-brown Nov 11, 2025
a10ed45
Merge branch 'staging' into bdms-221-jab-updates-to-pass-tests
jacob-a-brown Nov 11, 2025
2ba1271
fix: current_location is not nullable
jacob-a-brown Nov 11, 2025
826a6b6
feat: pass bdd test for well completion date
jacob-a-brown Nov 11, 2025
b34f62e
feat: pass well driller name bdd test
jacob-a-brown Nov 11, 2025
3d89a3e
feat: implement well construction method
jacob-a-brown Nov 11, 2025
ea00c9c
feat: implement well casing diameter in inches
jacob-a-brown Nov 11, 2025
cd4e174
feat: implement well pump type
jacob-a-brown Nov 11, 2025
ca6b6c4
feat: implement well pump depth
jacob-a-brown Nov 11, 2025
e87150a
feat: create new `measuring_point_history` model.
ksmuczynski Nov 11, 2025
545c2e8
feat: add new relationship to `Thing` model.
ksmuczynski Nov 11, 2025
15c770f
refactor: add new field to `measuring_point_history` model.
ksmuczynski Nov 11, 2025
aec217b
feat: at mp height & description to well transfer
jacob-a-brown Nov 11, 2025
505ae6e
feat: add well status and monitoring status to well transfer
jacob-a-brown Nov 11, 2025
8107e7c
feat: validate measuring point height for a well
jacob-a-brown Nov 11, 2025
647dc70
refactor: fix erase/rebuild for tests
jacob-a-brown Nov 12, 2025
40ed513
feat: get polymorphic record via function
jacob-a-brown Nov 10, 2025
23832ea
refactor: latest record must have null end date
jacob-a-brown Nov 10, 2025
ce1f522
refactor: move polymorphic record retrival to tests
jacob-a-brown Nov 10, 2025
d672c72
fix: call erase and rebuild db from core/initializers.py
jacob-a-brown Nov 12, 2025
e1ff3a3
feat: Add Notes schema and polymorphic relationships to Thing and Loc…
ksmuczynski Oct 22, 2025
a09348a
fix: Standardize location notes as List[NoteResponse] across schemas
ksmuczynski Oct 22, 2025
8ef4904
feat: enhance note management by adding release status and updating n…
jirhiker Nov 10, 2025
8837553
fix: streamline note handling by consolidating session commit and ref…
jirhiker Nov 12, 2025
955336a
Merge branch 'staging' into bdms-221
jacob-a-brown Nov 12, 2025
ddf6436
Merge branch 'bdms-221' into bdms-221-jab-transfer-updates
jacob-a-brown Nov 12, 2025
a61c958
Merge branch 'bdms-221' into bdms-221-jab-updates-to-pass-tests
jacob-a-brown Nov 12, 2025
a0d939f
Merge branch 'bdms-227' into bdms-227-jab-updates-to-pass-tests
jacob-a-brown Nov 12, 2025
e1df131
fix: remove duplicate lexicon
jacob-a-brown Nov 12, 2025
10ec9ec
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 12, 2025
0bccd4f
note: add note for AMMP review
jacob-a-brown Nov 12, 2025
5581ce2
feat: add PLSS as an organization to lexicon
jacob-a-brown Nov 12, 2025
35051be
Merge branch 'bdms-221' into kas-bdms-221-225-core-well-info-models-s…
ksmuczynski Nov 12, 2025
cafbb92
refactor: round m and ft conversion to 6 decimal places
jacob-a-brown Nov 12, 2025
3e1203c
refactor: set start/end date to date not datetime
jacob-a-brown Nov 12, 2025
2201ec1
refactor: use target_id and target_table in status_history
jacob-a-brown Nov 12, 2025
54c24e8
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 12, 2025
8d1d8fa
refactor: update 'measuring_point_history' model.
ksmuczynski Nov 12, 2025
f2f5e27
refactor: make well validations more readable
jacob-a-brown Nov 12, 2025
be7cb51
Merge pull request #244 from DataIntegrationGroup/kas-bdms-221-225-co…
jacob-a-brown Nov 12, 2025
1b87a3c
refactor: use cls for status history mixin
jacob-a-brown Nov 12, 2025
3090f93
Merge branch 'bdms-221' into bdms-221-jab-updates-to-pass-tests
jacob-a-brown Nov 12, 2025
bcfff8f
feat: eagerly load measuring point history records
jacob-a-brown Nov 12, 2025
7658fb5
feat: get mp height/description from latest record
jacob-a-brown Nov 12, 2025
2b5d489
refactor: use MeasuringPointHistory table for mp data
jacob-a-brown Nov 12, 2025
f130c42
feat: implement MonitoringFrequencyHistory table
jacob-a-brown Nov 12, 2025
494486b
refactor: remove monitoring frequency from group
jacob-a-brown Nov 12, 2025
85761c0
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 12, 2025
771dff4
refactor: update transfer script for monitoring frequency history table
jacob-a-brown Nov 12, 2025
ef1a4c8
refactor: update for measuring point history table
jacob-a-brown Nov 12, 2025
cabac98
feat: set group_type based off of wells' monitoring status
jacob-a-brown Nov 12, 2025
57bd631
feat: add DataProvenance model and enhance base mixins
ksmuczynski Nov 12, 2025
0e601fd
feat: add DataProvenanceMixin for polymorphic provenance tracking
ksmuczynski Nov 12, 2025
9feb596
refactor: use function to retrieve polymorphic records
jacob-a-brown Nov 12, 2025
a795783
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 12, 2025
3de8553
fix: remove polymorphic record retrieval from tests
jacob-a-brown Nov 12, 2025
49b3a8c
refactor: use function to retrieve polymorphic records
jacob-a-brown Nov 12, 2025
34856d5
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 12, 2025
8e70c85
Merge branch 'bdms-227-jab-bdms-229' into bdms-227-jab-updates-to-pas…
jacob-a-brown Nov 13, 2025
08d7aed
feat: update tests to include well casing materials
jacob-a-brown Nov 13, 2025
2e52b80
Merge branch 'staging' into transfer
jirhiker Nov 13, 2025
a6c5556
Merge pull request #240 from DataIntegrationGroup/bdms-221-jab-update…
jacob-a-brown Nov 13, 2025
13f2a45
refactor: rename Permission -> PermissionHistory | move mixin to same…
jacob-a-brown Nov 13, 2025
6e036e5
feat: add permission types to lexicon
jacob-a-brown Nov 13, 2025
f2184d2
refactor: refine polymorphic parent relationships.
ksmuczynski Nov 13, 2025
091637c
refactor: import PermissionHistoryMixin from correct dir
jacob-a-brown Nov 13, 2025
e78a963
Merge branch 'bdms-221' into bdms-221-jab-transfer-updates
jacob-a-brown Nov 13, 2025
71d8534
fix: fix imports for newly renamed PermissionHistory
jacob-a-brown Nov 13, 2025
bff2be3
feat: enhance contact and sensor transfer processes with improved err…
jirhiker Nov 13, 2025
b22619c
fix: import retrieve_latest_polymorphic_record from correct place
jacob-a-brown Nov 13, 2025
27b7c82
refactor: move DataProvenanceMixin to data_provenance.py and refactor…
ksmuczynski Nov 13, 2025
bf67ab0
fix: update transducer groundwater level endpoint to accept optional …
jirhiker Nov 13, 2025
1310375
Merge pull request #235 from DataIntegrationGroup/jir-fix-transducer
jirhiker Nov 13, 2025
4628720
Merge branch 'staging' into transfer
jirhiker Nov 13, 2025
825ec4a
feat: add permission_type to lexicon
jacob-a-brown Nov 13, 2025
8ed0ce4
feat: update util to correspond with bdms 221
jacob-a-brown Nov 13, 2025
73d3a48
refactor: Update lexicon and `enums.py` with DataProvenance related i…
ksmuczynski Nov 13, 2025
3b36c49
fix: sync bdms 221/227 for util functions
jacob-a-brown Nov 13, 2025
781d3f4
refactor: Update lexicon and `enums.py` with DataProvenance related i…
ksmuczynski Nov 13, 2025
1657bb9
feat: implement permissions
jacob-a-brown Nov 13, 2025
307f47c
feat: add is_suitable_for_datalogger to thing
jacob-a-brown Nov 13, 2025
ebc5451
fix: enhance error logging in transfer scripts to include table and f…
jirhiker Nov 14, 2025
4cebedb
fix: implemented well-notes tests
jirhiker Nov 14, 2025
ed7960a
fix: add notes fields to well and thing models
jirhiker Nov 14, 2025
3a31d0c
Merge branch 'refs/heads/staging' into jir-kas-notes-model
jirhiker Nov 14, 2025
e5897c8
refactor: rename notable_id and notable_type to target_id and target_…
jirhiker Nov 14, 2025
8cb720f
fix: comment out test notes and polymorphic relationship mappings in …
jirhiker Nov 14, 2025
a1614f6
Merge branch 'bdms-221' into kas-bdms-221-225-core-well-info-models-s…
jacob-a-brown Nov 17, 2025
66a843b
Merge pull request #245 from DataIntegrationGroup/kas-bdms-221-225-co…
jacob-a-brown Nov 17, 2025
e8bc1f1
fix: fix artifacts from merge conflicts
jacob-a-brown Nov 17, 2025
7136b07
[docker-compose] Add db healthcheck
TylerAdamMartinez Nov 17, 2025
5c287a6
fix: import DataProvenanceMixin from correct location
jacob-a-brown Nov 17, 2025
c27e169
fix: use logical name for record retrieval
jacob-a-brown Nov 17, 2025
25d7700
refactor: remove fields from location that are now in dataprovenance
jacob-a-brown Nov 17, 2025
4c9232e
refactor: use collection_method in DataProvenance model for elevation…
jacob-a-brown Nov 17, 2025
010bad4
fix: import DataProvenance to db/__init__.py
jacob-a-brown Nov 17, 2025
5ffb2cb
test: add elevation_method testing data
jacob-a-brown Nov 17, 2025
a7a6bb6
refactor: implement elevation_method from data provenance
jacob-a-brown Nov 17, 2025
b29543a
Merge pull request #246 from DataIntegrationGroup/BDMS-233-jir
jirhiker Nov 17, 2025
0875281
feat: implement well_depth_source
jacob-a-brown Nov 17, 2025
c80d4a3
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 17, 2025
a5cfa72
Merge pull request #249 from DataIntegrationGroup/TAM-Add-DB-HealthCheck
jirhiker Nov 17, 2025
9d07555
Merge branch 'staging' into jir-kas-notes-model
jirhiker Nov 17, 2025
109d2ed
Merge branch 'staging' into bdms-221
jacob-a-brown Nov 17, 2025
c396dd2
Merge branch 'bdms-221' into bdms-221-jab-updates-to-pass-tests
jacob-a-brown Nov 17, 2025
95624ed
feat: add session_ctx to development version init
chasetmartin Nov 17, 2025
ac1a33f
fix: fix artifacts from merge with staging
jacob-a-brown Nov 17, 2025
774a4a2
feat: enhance notes functionality in well and location models
jirhiker Nov 17, 2025
790c814
refactor: use function to get data provenance attributes
jacob-a-brown Nov 17, 2025
226ff1a
Merge pull request #250 from DataIntegrationGroup/bdms-221-jab-update…
jacob-a-brown Nov 17, 2025
2d2ca8b
Merge pull request #251 from DataIntegrationGroup/cm-session-test
jirhiker Nov 17, 2025
15116e7
Merge branch 'bdms-221-jab-updates-to-pass-tests' into bdms-221-jab-t…
jacob-a-brown Nov 17, 2025
ef016da
WIP: use data provenance table in transfers
jacob-a-brown Nov 18, 2025
574869d
Merge pull request #241 from DataIntegrationGroup/jir-kas-notes-model
jirhiker Nov 18, 2025
65e9510
fix: update location retrieval and enhance notes validation in tests
jirhiker Nov 18, 2025
809150e
fix: remove unnecessary decorator from well-notes.py
jirhiker Nov 18, 2025
840bc34
Merge pull request #252 from DataIntegrationGroup/bdms-233-testing
jirhiker Nov 18, 2025
cfc4e8f
fix: convert ngvd29 to navd88 for elevation where applicable
jacob-a-brown Nov 18, 2025
3e5a8f0
Merge branch 'bdms-221' into bdms-221-jab-transfer-updates
jacob-a-brown Nov 18, 2025
df238fa
refactor: address PR comments
jacob-a-brown Nov 18, 2025
784cb30
Merge pull request #242 from DataIntegrationGroup/bdms-221-jab-transf…
jacob-a-brown Nov 18, 2025
9bf12f9
Merge branch 'staging' into transfer
jirhiker Nov 18, 2025
0ae594d
fix: remove data provenance fields from pytest fixtures
jacob-a-brown Nov 18, 2025
e9d55b2
fix: make mp height optional for full thing response
jacob-a-brown Nov 18, 2025
92e3baf
fix: fix contact pytest tests
jacob-a-brown Nov 18, 2025
3d37770
fix: fix geospatial tests
jacob-a-brown Nov 18, 2025
0351854
fix: update location pytest tests
jacob-a-brown Nov 18, 2025
bdeef8a
fix: fix or skip thing pytest tests from feature file changes
jacob-a-brown Nov 18, 2025
a12d8ad
Merge branch 'staging' into bdms-221
jacob-a-brown Nov 18, 2025
9e4e518
fix: fix artifact from merge conflicts in pytest
jacob-a-brown Nov 18, 2025
8258a5f
fix: retrieve notes for location geojson response
jacob-a-brown Nov 18, 2025
d09ea21
fix: ensure all feature test wells have mp heights
jacob-a-brown Nov 18, 2025
5916de1
fix: current location note fix
jacob-a-brown Nov 18, 2025
23ee27a
refactor: simplify database initialization by removing session contex…
jirhiker Nov 18, 2025
f5a71a5
refactor: move lexicon and parameter initialization outside of databa…
jirhiker Nov 18, 2025
17a2ea7
Merge pull request #253 from DataIntegrationGroup/bdms-221
jirhiker Nov 18, 2025
8610d7e
Merge branch 'refs/heads/staging' into transfer
jirhiker Nov 18, 2025
681c788
refactor: streamline accuracy handling and improve logging in well tr…
jirhiker Nov 18, 2025
5748f14
refactor: enable pytest hook in pre-commit configuration
jirhiker Nov 18, 2025
0eedbb1
refactor: add PastOrTodayDate type for date validation in schemas
jirhiker Nov 18, 2025
8195837
refactor: implement elevation caching to optimize location processing
jirhiker Nov 18, 2025
09b831e
refactor: implement elevation caching to optimize location processing
jirhiker Nov 19, 2025
b250e2f
refactor: import get_storage_bucket in metrics.py for improved functi…
jirhiker Nov 19, 2025
2e5c9c5
Merge pull request #254 from DataIntegrationGroup/transfer
jirhiker Nov 19, 2025
82e100f
Merge branch 'staging' into bdms-227
jacob-a-brown Nov 19, 2025
38e86b2
Merge branch 'bdms-227' into bdms-227-jab-updates-to-pass-tests
jacob-a-brown Nov 19, 2025
b4c8beb
fix: fix artifacts from merge conflicts
jacob-a-brown Nov 19, 2025
2c33a79
feat: implement data source tests for well additional information
jacob-a-brown Nov 19, 2025
8ef2592
fix: remove outdated notes
jacob-a-brown Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 31 additions & 27 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Tests
name: Test Suite

on:
pull_request:
Expand All @@ -16,11 +16,8 @@ jobs:

services:
postgis:
# image: ghcr.io/dataintegrationgroup/nmdms:latest
# image: postgres
image: postgis/postgis:latest
# image: postgis/postgis:17-3.5
# image: timescale/timescaledb:2.18.0-pg17
# image: postgis/postgis:17-3.5
env:
POSTGRES_PASSWORD: postgres
options: >-
Expand All @@ -36,11 +33,6 @@ jobs:
- name: Check out source repository
uses: actions/checkout@v4

# - name: Install SpatiaLite
# run: |
# sudo apt-get update
# sudo apt-get install -y libsqlite3-mod-spatialite libspatialite-dev

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
Expand All @@ -62,26 +54,38 @@ jobs:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_DRIVER: postgres
# SPATIALITE_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu/mod_spatialite.so

run: uv run pytest -vv --durations=20 --cov --cov-report=xml --junitxml=junit.xml

# - name: Checkout BDD repo (features only)
# uses: actions/checkout@v4
# with:
# repository: DataIntegrationGroup/OcotilloBDD
# path: bdd
#
# - name: Copy BDD features into backend test directory
# run: |
# mkdir -p tests/features
# cp -r bdd/features/backend/* tests/features/
#
# - name: Run BDD tests
# env:
# BASE_URL: ${{ secrets.BACKEND_URL }}
# run: |
# uv run behave tests/features --tags=@backend,@approved --no-capture
- name: Checkout BDD repo (features only)
uses: actions/checkout@v4
with:
repository: DataIntegrationGroup/OcotilloBDD
path: bdd

- name: Copy BDD features into backend test directory
run: |
mkdir -p tests/features
cp -r bdd/features/backend/* tests/features/

- name: Run BDD tests
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DB_DRIVER: postgres
BASE_URL: http://localhost:8000
run: |
uv run behave tests/features --tags="@backend and @production" --no-capture
# uv run behave tests/features/transducer-data-response.feature \
# tests/features/thing-type-path-parameters.feature \
# tests/features/thing-query-parameters.feature \
# tests/features/well-notes.feature \
# tests/features/location-notes.feature \
# tests/features/geojson-response.feature
# use this when we have consensus on tag nomenclature
# uv run behave tests/features --tags="@backend and @production" --no-capture

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ transfers/data/nma_csv_cache/*
tests/features/*.feature
transfers/metrics/*
transfers/logs/*
run_bdd-local.sh


# deployment files
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ repos:
'--statistics'
]
exclude: ^db/__init__.py$ # all models need to be imported for Alembic, but are not used directly
- repo: local
hooks:
- id: pytest
name: pytest
entry: pytest # Or your specific test command, e.g., poetry run pytest
language: system
types: [python] # Specify relevant file types for your tests
pass_filenames: false
always_run: true
# - repo: local
# hooks:
# - id: pytest
# name: pytest
# entry: pytest # Or your specific test command, e.g., poetry run pytest
# language: system
# types: [python] # Specify relevant file types for your tests
# pass_filenames: false
# always_run: true

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.10.0 # Use the latest stable version or pin to your preference
Expand Down
15 changes: 10 additions & 5 deletions api/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
amp_editor_dependency,
amp_viewer_dependency,
)
from db import Observation
from db import Observation, Parameter
from schemas.observation import (
CreateGroundwaterLevelObservation,
GroundwaterLevelObservationResponse,
Expand Down Expand Up @@ -113,8 +113,6 @@ async def update_water_chemistry_observation(


# ============= Get ==============================================


@router.get(
"/transducer-groundwater-level",
summary="Get transducer groundwater level observations",
Expand All @@ -124,12 +122,19 @@ async def get_transducer_groundwater_level_observations(
session: session_dependency,
user: amp_viewer_dependency,
thing_id: int | None = None,
parameter_id: int | None = None,
start_time: datetime | None = None,
end_time: datetime | None = None,
) -> CustomPage[TransducerObservationWithBlockResponse]:

groundwater_parameter_id = (
session.query(Parameter)
.filter(Parameter.parameter_name == "groundwater level")
.one()
.id
)

return get_transducer_observations(
session, thing_id, parameter_id, start_time, end_time
session, thing_id, groundwater_parameter_id, start_time, end_time
)


Expand Down
9 changes: 5 additions & 4 deletions core/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
)
from fastapi.openapi.utils import get_openapi

from .initializers import init_db, init_lexicon, init_parameter, register_routes
from .initializers import (
register_routes,
erase_and_rebuild_db,
)
from .settings import settings


Expand All @@ -34,9 +37,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
Application lifespan event handler to initialize the database and lexicon.
"""
if settings.get_enum("MODE") == "development":
init_db()
init_lexicon()
init_parameter()
erase_and_rebuild_db()

register_routes(app)
yield
Expand Down
11 changes: 10 additions & 1 deletion core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
)
CasingMaterial: type[Enum] = build_enum_from_lexicon_category("casing_material")
CollectionMethod: type[Enum] = build_enum_from_lexicon_category("collection_method")
ConstructionMethod: type[Enum] = build_enum_from_lexicon_category("construction_method")
WellConstructionMethod: type[Enum] = build_enum_from_lexicon_category(
"well_construction_method"
)
ContactType: type[Enum] = build_enum_from_lexicon_category("contact_type")
CoordinateMethod: type[Enum] = build_enum_from_lexicon_category("coordinate_method")
WellPurpose: type[Enum] = build_enum_from_lexicon_category("well_purpose")
Expand All @@ -48,6 +50,7 @@
MonitoringStatus: type[Enum] = build_enum_from_lexicon_category("monitoring_status")
ParameterName: type[Enum] = build_enum_from_lexicon_category("parameter_name")
Organization: type[Enum] = build_enum_from_lexicon_category("organization")
OriginSource: type[Enum] = build_enum_from_lexicon_category("origin_source")
ParameterType: type[Enum] = build_enum_from_lexicon_category("parameter_type")
PhoneType: type[Enum] = build_enum_from_lexicon_category("phone_type")
PublicationType: type[Enum] = build_enum_from_lexicon_category("publication_type")
Expand All @@ -67,4 +70,10 @@
Vertical_datum: type[Enum] = build_enum_from_lexicon_category("vertical_datum")
ScreenType: type[Enum] = build_enum_from_lexicon_category("screen_type")
SensorType: type[Enum] = build_enum_from_lexicon_category("sensor_type")
WellPumpType: type[Enum] = build_enum_from_lexicon_category("well_pump_type")
PermissionType: type[Enum] = build_enum_from_lexicon_category("permission_type")
GroupType: type[Enum] = build_enum_from_lexicon_category("group_type")
MonitoringFrequency: type[Enum] = build_enum_from_lexicon_category(
"monitoring_frequency"
)
# ============= EOF =============================================
61 changes: 14 additions & 47 deletions core/initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,13 @@
from fastapi_pagination import add_pagination
from sqlalchemy import text
from sqlalchemy.exc import DatabaseError
from sqlalchemy.orm import Session

from db import Base
from db.engine import engine, session_ctx
from db.engine import session_ctx
from db.parameter import Parameter
from services.lexicon_helper import add_lexicon_term, add_lexicon_category


# ============= EOF =============================================
def init_db():
"""
Initialize the database by creating all tables.
This function is called during application startup.
"""

from sqlalchemy import text

with engine.connect() as conn:
conn.execute(text("DROP SCHEMA public CASCADE"))
conn.execute(text("CREATE SCHEMA public"))
conn.execute(text("CREATE EXTENSION IF NOT EXISTS postgis"))
conn.commit()

Base.metadata.drop_all(engine)
Base.metadata.create_all(engine)


def init_hypertables():
"""
Initialize hypertables for time-series data.
This function is called during application startup.
"""
# session = next(get_db_session())
# Create hypertables for time-series data
with session_ctx() as session:
session.execute(
text("select create_hypertable('observation', 'observation_datetime');")
)

# session.commit()
# session.close()


def init_parameter(path: str = None) -> None:
"""
Populate the parameter table to allow their use in creating and editing
Expand Down Expand Up @@ -91,17 +55,17 @@ def init_parameter(path: str = None) -> None:
session.rollback()


def erase_and_rebuild_db(session: Session):
from sqlalchemy import text

with session.bind.connect() as conn:
conn.execute(text("DROP SCHEMA public CASCADE"))
conn.execute(text("CREATE SCHEMA public"))
conn.execute(text("CREATE EXTENSION IF NOT EXISTS postgis"))
conn.commit()
def erase_and_rebuild_db():
with session_ctx() as session:
session.execute(text("DROP SCHEMA public CASCADE"))
session.execute(text("CREATE SCHEMA public"))
session.execute(text("CREATE EXTENSION IF NOT EXISTS postgis"))
session.commit()
Base.metadata.drop_all(session.bind)
Base.metadata.create_all(session.bind)

Base.metadata.drop_all(session.bind)
Base.metadata.create_all(session.bind)
init_lexicon()
init_parameter()


def init_lexicon(path: str = None) -> None:
Expand Down Expand Up @@ -174,3 +138,6 @@ def register_routes(app):
app.include_router(search_router)
app.include_router(thing_router)
add_pagination(app)


# ============= EOF =============================================
Loading
Loading