diff --git a/snowexsql/tables/layer_data.py b/snowexsql/tables/layer_data.py index 677bbf79..169f2315 100644 --- a/snowexsql/tables/layer_data.py +++ b/snowexsql/tables/layer_data.py @@ -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 diff --git a/snowexsql/tables/site.py b/snowexsql/tables/site.py index a5779ef7..ef89436f 100644 --- a/snowexsql/tables/site.py +++ b/snowexsql/tables/site.py @@ -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 @@ -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') diff --git a/tests/factories/layer_data.py b/tests/factories/layer_data.py index f96090bc..9e0cbbfb 100644 --- a/tests/factories/layer_data.py +++ b/tests/factories/layer_data.py @@ -19,7 +19,6 @@ class Meta: depth = 100.0 bottom_depth = 90.0 - comments = 'Layer comment' value = '40' measurement_type = factory.SubFactory( @@ -41,7 +40,6 @@ class LayerDensityFactory(LayerDataFactory): depth = 15.0 bottom_depth = 5.0 value = '236.0' - comments = 'Sample_A' site = factory.SubFactory( SiteFactory, diff --git a/tests/factories/site.py b/tests/factories/site.py index f70e291a..975fc833 100644 --- a/tests/factories/site.py +++ b/tests/factories/site.py @@ -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( diff --git a/tests/tables/test_layer_data.py b/tests/tables/test_layer_data.py index 56f8bb0e..b86057cf 100644 --- a/tests/tables/test_layer_data.py +++ b/tests/tables/test_layer_data.py @@ -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 diff --git a/tests/tables/test_site.py b/tests/tables/test_site.py index 6e1c6cc0..28b2162e 100644 --- a/tests/tables/test_site.py +++ b/tests/tables/test_site.py @@ -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)