Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion snowexsql/tables/layer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class LayerData(HasMeasurementType, HasInstrument, Base):

depth = Column(Float, nullable=False, index=True)
bottom_depth = Column(Float)
comments = Column(Text)
value = Column(Text, nullable=False, index=True)

# Link the site id with a foreign key
Expand Down
6 changes: 4 additions & 2 deletions snowexsql/tables/site.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List

from sqlalchemy import (
Column, Date, Float, ForeignKey, Integer, String, Index
Column, Date, Float, ForeignKey, Index, Integer, String, Text
)
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import Mapped, mapped_column, relationship
Expand Down Expand Up @@ -58,7 +58,9 @@ class Site(SingleLocationData, Base, InCampaign, HasDOI):
ground_vegetation = Column(String())
vegetation_height = Column(String())
tree_canopy = Column(String())
site_notes = Column(String())
# Example: Top right comment section on a pit sheet
comments = Column(Text)


# Relationships
layer_data = relationship('LayerData', lazy='joined')
Expand Down
2 changes: 0 additions & 2 deletions tests/factories/layer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class Meta:

depth = 100.0
bottom_depth = 90.0
comments = 'Layer comment'
value = '40'

measurement_type = factory.SubFactory(
Expand All @@ -41,7 +40,6 @@ class LayerDensityFactory(LayerDataFactory):
depth = 15.0
bottom_depth = 5.0
value = '236.0'
comments = 'Sample_A'

site = factory.SubFactory(
SiteFactory,
Expand Down
2 changes: 1 addition & 1 deletion tests/factories/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Meta:
ground_vegetation = "Bare"
vegetation_height = "None"
tree_canopy = "Open"
site_notes = "Site Notes"
comments = "Observer comment on site"

# Single Location data
geom = WKTElement(
Expand Down
3 changes: 0 additions & 3 deletions tests/tables/test_layer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ def test_bottom_depth_attribute(self):
assert type(self.subject.bottom_depth) is float
assert self.subject.bottom_depth == self.attributes.bottom_depth

def test_comments_attribute(self):
assert self.subject.comments == self.attributes.comments

def test_value_attribute(self):
assert self.subject.value == self.attributes.value

Expand Down
8 changes: 5 additions & 3 deletions tests/tables/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,17 @@ def test_vegetation_height_attribute(self):
def test_tree_canopy_attribute(self):
assert self.subject.tree_canopy == self.attributes.tree_canopy

def test_site_notes_attribute(self):
assert self.subject.site_notes == self.attributes.site_notes

def test_elevation_attribute(self, point_data_factory):
assert self.subject.elevation == point_data_factory.elevation

def test_geom_attribute(self):
assert isinstance(self.subject.geom, WKBElement)

def test_comments_attribute(self):
assert self.subject.comments == self.attributes.comments

# Relationships
# -------------
def test_in_campaign(self):
assert self.subject.campaign is not None
assert isinstance(self.subject.campaign, Campaign)
Expand Down