This fixes an issue on Windows where the units database could not be found (udunits2.xml). This resulted as an assertion error when importing cfunits from within pymt,
The issue is that udunits2 library can not correctly find udunits2.xml in the default location. On Windows anyway. To fix this, I set the UDUNITS_XML_PATH environment variable in pymt/__init__.py to point to the path of udunits2.xml within the cfunits package. I do this for all platforms, not just Windows but I think that should be fine.
Coverage increased (+0.03%) to 71.379% when pulling b583c440e7549b7b5a2be3806c06481346a4f6a0 on mcflugen/fix-cfunits-import-error-on-windows into cd191bec7202923b1280f9ee9e794c5269043b25 on master.
This fixes an issue on Windows where the units database could not be found (
udunits2.xml
). This resulted as an assertion error when importing cfunits from within pymt,The issue is that udunits2 library can not correctly find
udunits2.xml
in the default location. On Windows anyway. To fix this, I set theUDUNITS_XML_PATH
environment variable inpymt/__init__.py
to point to the path ofudunits2.xml
within the cfunits package. I do this for all platforms, not just Windows but I think that should be fine.