csdms / bmi-python Goto Github PK
View Code? Open in Web Editor NEWBasic Model Interface for Python
Home Page: https://bmi.readthedocs.io
License: MIT License
Basic Model Interface for Python
Home Page: https://bmi.readthedocs.io
License: MIT License
In the get_*_var_names
methods, the type hint is tuple[str]
, however the docstrings state:
"""List of a model's output variables.
and:
list of str
So which one should it be?
The type hints of the Bmi
class have a couple of return types as tuple[str]
. For example:
Line 106 in 793f566
However, in python's typing system this means a tuple containing a single string. For a tuple of strings the correct type hint is:
def get_input_var_names(self) -> tuple[str, ...]:
To quote the Python documentation on this:
To denote a tuple which could be of any length, and in which all elements are of the same type T, use tuple[T, ...].
This package, in my opinion, has too many unnecessary dependencies. It think we should use argparse instead of click and make black an optional dependency.
I just noticed in
Lines 394 to 407 in 0fcca44
That the argument name values
does not match the src
in the docstring and the src
on the BMI website.
Since in Python these are not strictly positional but can be addressed as keyword arguments as well, I didn't just want to change it.
To allow others to use the type hints provided in the bmipy/bmi.py:Bmi
class, a py.typed
file is required in the bmipy
folder.
See the PEP-0561 info.
Without this file, type checkers cannot make use of the type hints, and mypy will return the following error:
error: Skipping analyzing "bmipy": module is installed, but missing library stubs or py.typed marker [import]
On Windows, an error is thrown when attempting to import from a file created by bmipy-render
. To reproduce it, try these steps:
bmipy-render
to create a new file for a MyBmi class:$ bmipy-render MyBmi > mybmi.py
$ python -c "from mybmi import MyBmi"
The result is an error, with message
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Mark\projects\bmi-python\mybmi.py", line 539
"""
^
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0x93 in position 483: invalid start byte
A new release on PyPI should be published, since the most recent is 2.0 from December 2019. This will resolved a pip warning:
DEPRECATION: bmipy is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change.
This was already resolved by #12
We're generally moving CSDMS tools from versioneer to zest.releaser.
We should add documentation on how to use bmipy-render
.
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.