corneliusroemer / pango_aliasor

Utility to alias and dealias pango lineages
MIT License
21 stars 6 forks source link

ModuleNotFoundError: No module named 'pango_designation' #2

Closed Wytamma closed 2 years ago

Wytamma commented 2 years ago

Current Behavior
pango_aliasor doesn't download the latest alias_key.json and raises error ModuleNotFoundError: No module named 'pango_designation'. I think this is because you are using importlib.resources.open_text("pango_designation", "alias_key.json") i.e. it's looking for a pango_designation module that doesn't exists (although not sure why the tests are passing then...).

Expected behavior
Download latest if alias_key is not specified.

How to reproduce
Steps to reproduce the current behavior:

  1. pip install pango_aliasor
  2. run the example in README

Possible solution
Use urllib to load alias_key.json from Github.

import urllib.request, json 
with urllib.request.urlopen("https://raw.githubusercontent.com/cov-lineages/pango-designation/master/pango_designation/alias_key.json") as data:
    file = json.load(data)