Skip to content

Commit

Permalink
MetadataMapper reads mappings from package data, not file system
Browse files Browse the repository at this point in the history
  • Loading branch information
tillbiskup committed Nov 5, 2021
1 parent 616ecbc commit 557c510
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ include LICENSE*

# Include mapper recipes
include aspecd/*_mapper.yaml

# Include templates
recursive-include aspecd/templates *
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0.dev25
0.6.0.dev26
6 changes: 3 additions & 3 deletions aspecd/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ class needs to make sure that as many metadata as possible are read and

import datetime
import logging
import os

import aspecd.exceptions
import aspecd.utils
Expand Down Expand Up @@ -1165,9 +1164,10 @@ def create_mappings(self):
self._add_mappings_from_recipe()

def _load_mapping_recipe_from_file(self):
root_path = os.path.split(os.path.abspath(__file__))[0]
yaml_file = aspecd.utils.Yaml()
yaml_file.read_from(os.path.join(root_path, self.recipe_filename))
# noinspection PyTypeChecker
yaml_file.read_stream(
aspecd.utils.get_package_data(self.recipe_filename))
self._mapping_recipes = yaml_file.dict

def _choose_mapping_recipe(self):
Expand Down
2 changes: 0 additions & 2 deletions docs/roadmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ For version 0.6

* Report task: automatically generate filenames in case they are not given, similar to plots

* Handling of mapper recipe (from package source, not from directory)


For version 0.7
===============
Expand Down

0 comments on commit 557c510

Please sign in to comment.