Skip to content
Open
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
12 changes: 11 additions & 1 deletion src/incatools/odk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def update_config_dict(obj: Dict[str, Any]) -> None:
# First take care of stubs, if needed
update_stubs(obj)

# Then all the other changes
# Then all the other simple changes
changes = [
# old key path new key path
("reasoner", "robot.reasoner"),
Expand All @@ -213,6 +213,16 @@ def update_config_dict(obj: Dict[str, Any]) -> None:
else:
logging.warning(f"Option {old} is deprecated")

# Then the more complex changes, that cannot be handled simply by
# renaming or moving keys around.

# `use_base: True` ==> `use_variant: base`
if "import_group" in obj:
for imp in obj["import_group"]["products"]:
use_base = imp.pop("use_base", False)
if use_base:
imp["use_variant"] = "base"


def pop_key(obj: Dict[str, Any], path: str) -> Optional[str]:
"""Gets the value of a key in a nested dictionary structure.
Expand Down
4 changes: 2 additions & 2 deletions src/incatools/odk/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ class ImportProduct(Product):
for the list of allowed values and their meaning.
"""

use_base: bool = False
"""If true, download the -base version of the upstream source.
use_variant: Optional[str] = None
"""If set, use the specified variant of the ontology.

Only meaningful if ``mirror_from`` is not set, that is if the
upstream source is downloaded from http://purl.obolibrary.org/obo/.
Expand Down
2 changes: 1 addition & 1 deletion src/incatools/odk/templates/src/ontology/Makefile.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ download-mirror-{{ ont.id }}: | $(TMPDIR)
odk-helper download --output $(TMPDIR)/$@.owl \
--reference $(MIRRORDIR)/{{ ont.id }}.owl \
--max-retry {{ project.import_group.mirror_retry_download }} \
{% if ont.mirror_from %}{{ ont.mirror_from }}{% elif ont.use_base %}$(OBOBASE)/{{ ont.id }}/{{ ont.id }}-base.owl{% if ont.use_gzipped %}.gz{% endif %}{% else %}$(OBOBASE)/{{ ont.id }}.owl{% if ont.use_gzipped %}.gz{% endif %}{% endif %}
{% if ont.mirror_from %}{{ ont.mirror_from }}{% elif ont.use_variant is not none %}$(OBOBASE)/{{ ont.id }}/{{ ont.id }}-{{ ont.use_variant }}.owl{% if ont.use_gzipped %}.gz{% endif %}{% else %}$(OBOBASE)/{{ ont.id }}.owl{% if ont.use_gzipped %}.gz{% endif %}{% endif %}

{% if ont.mirror_type == 'custom' -%}
$(MIRRORDIR)/{{ ont.id }}.owl:
Expand Down
Loading