Skip to content

Commit

Permalink
Issue #144 add start and end time to site
Browse files Browse the repository at this point in the history
  • Loading branch information
micah-prime committed Oct 22, 2024
1 parent ec449ee commit a05a6c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion snowexsql/tables/site.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List

from sqlalchemy import Column, Date, Float, ForeignKey, Integer, String
from sqlalchemy import Column, Date, Float, ForeignKey, Integer, String, Time
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import Mapped, mapped_column, relationship

Expand Down Expand Up @@ -53,6 +53,8 @@ class Site(SingleLocationData, Base, InCampaign, HasDOI):
vegetation_height = Column(String())
tree_canopy = Column(String())
site_notes = Column(String())
start_time = Column(Time)
end_time = Column(Time)

@hybrid_property
def date(self):
Expand Down
5 changes: 4 additions & 1 deletion tests/db_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def _add_entry(
geom=kwargs.pop("geom"),
elevation=kwargs.pop("elevation"),
observers=observer_list,
start_time=kwargs.pop("start_time"),
end_time=kwargs.pop("end_time"),
)
)
else:
Expand Down Expand Up @@ -124,7 +126,8 @@ def populated_layer(self, db):
"POINT(747987.6190615438 4324061.7062127385)", srid=26912
),
'value': '42.5',
'sample_a': '42.5'
'sample_a': '42.5',
"start_time": "10:32:00", "end_time": "10:39:00"
}
self._add_entry(
db.url, LayerData, 'fakeinstrument', ["TEST"],
Expand Down

0 comments on commit a05a6c6

Please sign in to comment.