csdms / bmi-tester Goto Github PK
View Code? Open in Web Editor NEWTest a BMI in Python
Home Page: https://bmi-tester.readthedocs.io
License: MIT License
Test a BMI in Python
Home Page: https://bmi-tester.readthedocs.io
License: MIT License
I tried to install bmi-tester with pip on Linux and it failed. Here are my steps:
mamba create -n test -c conda-forge python pip
conda activate test
pip install bmi-tester &> install.log
I've attached the install.log
file. Note that pip fetched an older version of bmi-tester, v0.5.4.
I can install the current version of bmi-tester, v0.5.5, with conda/mamba.
A warning about using distutils is emitted when running bmi-tester in Python 3.11:
/home/mpiper/anaconda3/envs/logo/lib/python3.11/site-packages/bmi_tester/tests/conftest.py:57:
DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
BMI_VERSION = StrictVersion(BMI_VERSION_STRING)
I haven't tried it, but I guess this would break in Python 3.12.
I think the load_component function in the bmi_tester/bmipytest module needs a slight modification. Currently, line 50 of the module is
component = module.__dict__[cls_name]
When I run this on CEM (C) and ECSimpleSnow (Fortran), the component
variable is returned as:
<class 'pymt_cem.lib.cem.Cem'>
<class 'pymt_ecsimplesnow.lib.ecsimplesnow.ECSimpleSnow'>
This causes a problem when running the bmi-test script. For example, running:
$ bmi-test pymt_cem.bmi:Cem -vvv
produces this stack trace (only last part shown):
File "/Users/mpiper/anaconda3/envs/_testing/lib/python3.7/site-packages/bmi_tester/bmipytest.py", line 114, in main
config_file = query(model, "run.config_file.path")
File "/Users/mpiper/anaconda3/envs/_testing/lib/python3.7/site-packages/model_metadata/api.py", line 18, in query
if os.path.isdir(model):
File "/Users/mpiper/anaconda3/envs/_testing/lib/python3.7/genericpath.py", line 42, in isdir
st = os.stat(s)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not type
When I change line 50 of the module to
component = module.__dict__[cls_name].__name__
the component
variable is returned as
Cem
ECSimpleSnow
and bmi-test runs to completion.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.