Commit d9443876 authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

Renamed TaxonomyMapper

parent 296a66d3
......@@ -40,7 +40,7 @@ def read_csv(fn: str) -> list[dict[str, str]]:
return taxonomy_reader
class TaxonomyMapper:
class TaxonomyOccupancyMapper:
"""Map building tags to `GEM_taxonomy_occupancy`"""
......@@ -68,7 +68,7 @@ class TaxonomyMapper:
@classmethod
def from_csv(cls, fn: str):
"""Read a csv and initialize a `TaxonomyMapper`."""
"""Read a csv and initialize a `TaxonomyOccupancyMapper`."""
taxonomy = read_csv(fn)
grouped_taxonomy = group_taxonomy(taxonomy)
......
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
from rabotnikobm.taxonomy.gem_taxonomy import group_taxonomy, TaxonomyMapper
from rabotnikobm.taxonomy.gem_taxonomy import group_taxonomy, TaxonomyOccupancyMapper
def test_group_taxonomy():
......@@ -32,13 +32,13 @@ def test_group_taxonomy():
def test_mapper_from_csv(pytestconfig):
demo_file = pytestconfig.rootpath / "data/rules/occupancy/building_and_PoIs_tags.csv"
mapper = TaxonomyMapper.from_csv(demo_file)
mapper = TaxonomyOccupancyMapper.from_csv(demo_file)
assert mapper
def test_taxonomy_mapper_building_pois(pytestconfig):
demo_file = pytestconfig.rootpath / "data/rules/occupancy/building_and_PoIs_tags.csv"
mapper = TaxonomyMapper.from_csv(demo_file)
mapper = TaxonomyOccupancyMapper.from_csv(demo_file)
sample_tags = [{"amenity": "community_centre"}, {"amenity": "cafe"}, {"x": "y"}]
......@@ -47,7 +47,7 @@ def test_taxonomy_mapper_building_pois(pytestconfig):
def test_taxonomy_mapper_landuse(pytestconfig):
demo_file = pytestconfig.rootpath / "data/rules/occupancy/landuse_tags.csv"
mapper = TaxonomyMapper.from_csv(demo_file)
mapper = TaxonomyOccupancyMapper.from_csv(demo_file)
sample_tags = [{"amenity": "university", "a": "b"}, {"landuse": "brownfield"}, {"x": "y"}]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment