csdms / bmi-example-python Goto Github PK
View Code? Open in Web Editor NEWAn example of wrapping a model written in Python with a BMI
Home Page: https://bmi.readthedocs.io
License: MIT License
An example of wrapping a model written in Python with a BMI
Home Page: https://bmi.readthedocs.io
License: MIT License
According to the BMI spec, the filename argument for the BMI initialize method must not be optional and must be a string. Right now BmiHeat.initialize
accepts either None
, a file-like object, or a string. I think this should be changed so that it only accepts a string that is a path to a configuration file.
i.e.
def initialize(self, filename: str):
with open(filename) as file_obj:
self._model = Heat.from_file_like(file_obj)
...
Actually, in looking at what's there now, I think there's also a bug. Heat.from_file_like
must take a stream, not a string
i.e.
Heat.from_file_like(file_obj.read())
should be
Heat.from_file_like(file_obj)
Should we expand the set of requirements files for this repository? I'm thinking about four separate files.
requirements.txt -- packages needed to install with pip install -e .
requirements-dev.txt -- developer packages used with the repo Makefile
requirements-testing.txt -- packages used for running tests
requirements-examples.txt -- packages used for running examples
Versioneer is sunsetting and zest.releaser is the recommended replacement.
This is a legacy folder that should be removed. All BMI docs are built from the main BMI repository.
Also remove docs badge from README.
Apparently this was an alias, and it was recently removed. See scipy/scipy#14889.
This import is only used once, in the heat.py
module.
In this example, the current set_value implementation is:
bmi-example-python/heat/bmi_heat.py
Lines 239 to 250 in e6b1e91
A problem arises when the model variable referenced by get_value_ptr is dimensional--the input src
argument is flattened, by definition, while the val
variable is dimensional. This raises an exception with a message like
ValueError: could not broadcast input array from shape (48,) into shape (8,6)
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.