Giter VIP home page Giter VIP logo

bmi-tester's People

Contributors

mcflugen avatar mdpiper avatar mwtoews avatar pre-commit-ci[bot] avatar sc0tts avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bmi-tester's Issues

Current version of bmi-tester is not pip-installable

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.

install.log

Replace use of distutils.version

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.

Return string type from load_component function

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.