From cf90346a721d86168b1ceeac63f648e8ae264ce6 Mon Sep 17 00:00:00 2001 From: Arthur Zalevsky Date: Wed, 20 Mar 2024 08:08:14 -0700 Subject: [PATCH] added python-ihm version and bumped report version to 1.1 --- ihm_validation/report.py | 5 +++++ ihm_validation/utility.py | 5 +++++ templates/full_validation_pdf.html | 4 +++- templates/main.html | 5 ++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ihm_validation/report.py b/ihm_validation/report.py index fb2e6b60..30cab21a 100644 --- a/ihm_validation/report.py +++ b/ihm_validation/report.py @@ -23,6 +23,8 @@ from collections import Counter import numpy as np +REPORT_VERSION = '1.1' + class WriteReport(object): def __init__(self, mmcif_file, db, driver, cache, nocache=False): self.mmcif_file = mmcif_file @@ -32,6 +34,7 @@ def __init__(self, mmcif_file, db, driver, cache, nocache=False): self.driver = driver self.cache = cache self.nocache = nocache + self.report_version = REPORT_VERSION def run_entry_composition(self, Template_Dict: dict) -> dict: @@ -50,6 +53,8 @@ def run_entry_composition(self, Template_Dict: dict) -> dict: # to print out tables. Why Sai?--because JS is annoying and it is just easier # to construct tables with lists than any other data struc # utility module has functions to check outputs from python-ihm library and convert to JS friendly format + Template_Dict['report_version'] = self.report_version + Template_Dict['python_ihm_version'] = utility.get_python_ihm_version() Template_Dict['ensemble_info'] = ensemble_info Template_Dict['sphere'] = self.input.check_sphere() Template_Dict['num_ensembles'] = self.input.check_ensembles() diff --git a/ihm_validation/utility.py b/ihm_validation/utility.py index f20d8cfe..b501d9c9 100644 --- a/ihm_validation/utility.py +++ b/ihm_validation/utility.py @@ -518,3 +518,8 @@ def compress_cx_stats(cx_stats: dict) -> list: out_stats.append(mgv['cx_stats']['All']['Satisfied']) return out_stats + +def get_python_ihm_version() -> str: + """returns Python-IHM version""" + import ihm + return ihm.__version__ diff --git a/templates/full_validation_pdf.html b/templates/full_validation_pdf.html index 879ab607..c15bd10d 100644 --- a/templates/full_validation_pdf.html +++ b/templates/full_validation_pdf.html @@ -139,6 +139,8 @@

Integrative Structure Validation Report {{ date }}

The following software was used in the production of this report:

diff --git a/templates/main.html b/templates/main.html index 03130406..00bcd759 100644 --- a/templates/main.html +++ b/templates/main.html @@ -186,6 +186,9 @@

The following software was used in the production of this report.