Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASyH 1.0: report.j2 not found #8

Open
HaraldWilhelmi opened this issue Jul 26, 2023 · 1 comment
Open

ASyH 1.0: report.j2 not found #8

HaraldWilhelmi opened this issue Jul 26, 2023 · 1 comment

Comments

@HaraldWilhelmi
Copy link

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
Copy link
Author

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

It seems that there are two issues in the code:

  • "return env.get_template('report.j2')" - this call does not specify the path to search the template in (what are the defaults? should we rely on then?)
  • The bundled package seems not to contain report.j2.

HaraldWilhelmi pushed a commit that referenced this issue Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant