dieterich-lab / ASyH

The Anonymous Synthesizer for Health Data
MIT License
3 stars 0 forks source link

ASyH 1.0: report.j2 not found #8

Open HaraldWilhelmi opened 1 year ago

HaraldWilhelmi commented 1 year ago

Generating a report with ASyH 1.0.0 will fail with errors like:

Traceback (most recent call last):
  File "/beegfs/scratch/ASyH/ARX-ASyH-Comparison/ASyH-scripts/2-train+sample+report.py", line 35, in 
    report.generate(dataset, asyh_application.model.model_type)
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/ASyH/report.py", line 49, in generate
    markdown = self.get_mark_down_report(dataset_name, sd_model_name, images)
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/ASyH/report.py", line 107, in get_mark_down_report
    jinja_template = self._get_report_template()
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/ASyH/report.py", line 124, in _get_report_template
    return env.get_template('report.j2')
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/jinja2/environment.py", line 1010, in get_template
    return self._load_template(name, globals)
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/jinja2/environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/jinja2/loaders.py", line 126, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/beegfs/homes/hwilhelmi/.venvs/ASyH/lib/python3.9/site-packages/jinja2/loaders.py", line 218, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: report.j2
HaraldWilhelmi commented 1 year ago

Most likely the issue can be avoided if working with 'pip install -e .'.

It seems that there are two issues in the code: