EnzymeML / PyEnzyme

🧬 - Data management and modeling framework based on EnzymeML.
BSD 2-Clause "Simplified" License
21 stars 9 forks source link

Type checking issue #21

Closed fbergmann closed 2 years ago

fbergmann commented 2 years ago

I finally figured out why we always got these errors:


  178 
    179     @staticmethod
--> 180     def _getUniProtParameters(uniprotid: str) -> dict[str, Any]:
    181         import requests
    182         import xml.etree.ElementTree as ET

TypeError: 'type' object is not subscriptable

The issue here is that you are directly using dict when you should be using Dict from the typing module. It would be best to replace all instances. Where you use dict as type annotations. that way the library would still work with python 3.7 (which is for example what binder uses by default).

fbergmann commented 2 years ago

The same applies to List and Tuple. This is really important to do because the binder instance for the paper right now also does not work.

JR-1991 commented 2 years ago

Thanks for pointing that out, I will rewrite all annotations for 3.7 compatibility.

JR-1991 commented 2 years ago

Has been fixed. Tests are passing now with the current version.