unibz-core / Scior

Identification of ontological categories for OWL ontologies.
https://purl.org/scior
Apache License 2.0
3 stars 1 forks source link

Treat OntCatOWL input without any gUFO information #13

Closed pedropaulofb closed 1 year ago

pedropaulofb commented 1 year ago

OntCatOWL may present a zero division error when a user provides an input without any gUFO information.

File "E:\Work\PhD\OntCatOWL\OntCatOwl\ontcatowl\main.py", line 133, in <module>run_ontcatowl()
File "E:\Work\PhD\OntCatOWL\OntCatOwl\ontcatowl\main.py", line 83, in run_ontcatowl
    consolidated_statistics = calculate_final_statistics(before_statistics, after_statistics)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Work\PhD\OntCatOWL\OntCatOwl\ontcatowl\modules\results_calculation.py", line 297, in calculate_final_statistics
    statistics_classes_before.calculate()
  File "E:\Work\PhD\OntCatOWL\OntCatOwl\ontcatowl\modules\results_classes.py", line 76, in calculate
    self.tu_classes_types_p = (self.tu_classes_types_v / self.total_classes_number) * 100
                               ~~~~~~~~^~~~~~~~~~~
ZeroDivisionError: division by zero
python-BaseException
pedropaulofb commented 1 year ago

Input validation added for both run_ontcatowl and run_ontcatowl_tester functions implemented in commit 2ecd169db4a3b0e5fa1d3c7b28973a32a96d7b06