Skip to content

Commit

Permalink
Merge pull request #202 from gaiaresources/BDRSPS-787
Browse files Browse the repository at this point in the history
BDRSPS-787 Removed instructions method from mapper and removed instructions pdf files for new draft templates.
  • Loading branch information
Lincoln-GR authored Sep 11, 2024
2 parents 780114b + 15acbf9 commit 0e657af
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 40 deletions.
19 changes: 0 additions & 19 deletions abis_mapping/base/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class ABISMapper(abc.ABC):
# ABIS Mapper Registry
registry: dict[str, type["ABISMapper"]] = {}

# ABIS Mapper Template ID and Instructions File
instructions_file: str = NotImplemented # Must be implemented

# Default Dataset Metadata
DATASET_DEFAULT_NAME = "Example Dataset"
DATASET_DEFAULT_DESCRIPTION = "Example Dataset by Gaia Resources"
Expand Down Expand Up @@ -348,22 +345,6 @@ def fields(cls) -> dict[str, types.schema.Field]:
# Return dictionary of fields
return {f.name: f for f in schema.fields}

@final
@classmethod
@functools.lru_cache
def instructions(cls) -> pathlib.Path:
"""Retrieves and Caches the Template Instructions
Returns:
pathlib.Path: Filepath for this Template's Instructions
"""
# Retrieve Template Filepath
directory = pathlib.Path(inspect.getfile(cls)).parent
instructions_file = directory / cls.instructions_file

# Return
return instructions_file

@final
@classmethod
def register_mapper(
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
class IncidentalOccurrenceMapper(base.mapper.ABISMapper):
"""ABIS Mapper for `incidental_occurrence_data.csv` - version 3"""

# Instructions File
instructions_file = "instructions.pdf"

# Default Dataset Metadata
DATASET_DEFAULT_NAME = "Example Incidental Occurrence Dataset"
DATASET_DEFAULT_DESCRIPTION = "Example Incidental Occurrence Dataset by Gaia Resources"
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions abis_mapping/templates/survey_metadata_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class AttributeValue:
class SurveyMetadataMapper(base.mapper.ABISMapper):
"""ABIS mapper for `survey_metadata.csv` v2"""

# Instructions filename
instructions_file = "instructions.pdf"

# Default Dataset Metadata
DATASET_DEFAULT_NAME = "Example Systematic Survey Metadata Dataset"
DATASET_DEFAULT_DESCRIPTION = "Example Systematic Survey Metadata Dataset by Gaia Resources"
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions abis_mapping/templates/survey_occurrence_data_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
class SurveyOccurrenceMapper(base.mapper.ABISMapper):
"""ABIS Mapper for `survey_occurrence_data.csv` v2"""

# Instructions File
instructions_file = "instructions.pdf"

# Default Dataset Metadata
DATASET_DEFAULT_NAME = "Example Systematic Survey Occurrence Dataset"
DATASET_DEFAULT_DESCRIPTION = "Example Systematic Survey Occurrence Dataset by Gaia Resources"
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions abis_mapping/templates/survey_site_data_v2/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ class Agent:
class SurveySiteMapper(base.mapper.ABISMapper):
"""ABIS Mapper for `survey_site_data.csv` v2"""

# Instructions File
instructions_file = "instructions.pdf"

# Default Dataset Metadata
DATASET_DEFAULT_NAME = "Example Systematic Survey Site Dataset"
DATASET_DEFAULT_DESCRIPTION = "Example Systematic Survey Site Dataset by Gaia Resources"
Expand Down
9 changes: 0 additions & 9 deletions tests/templates/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,6 @@ def test_get_schema(self, test_params: conftest.TemplateTestParameters) -> None:
schema = real_mapper.schema()
assert isinstance(schema, dict)

def test_get_instructions(self, test_params: conftest.TemplateTestParameters) -> None:
"""Tests able to retrieve template instructions."""
# Test Real Template ID
real_mapper = abis_mapping.base.mapper.get_mapper(test_params.template_id)
assert real_mapper is not None
instructions = real_mapper.instructions()
assert isinstance(instructions, pathlib.Path)
assert instructions.is_file()

def test_geodetic_datum_proj_supported(self, test_params: conftest.TemplateTestParameters) -> None:
"""Test that all enumerated values for geodeticDatum are supported by proj."""
# Get mapper
Expand Down

0 comments on commit 0e657af

Please sign in to comment.