open-atmos / pypartmc Goto Github PK
View Code? Open in Web Editor NEWPython (and C++) interface to PartMC with Jupyter/Python, Julia and Matlab examples
Home Page: https://open-atmos.github.io/PyPartMC/
License: GNU General Public License v3.0
Python (and C++) interface to PartMC with Jupyter/Python, Julia and Matlab examples
Home Page: https://open-atmos.github.io/PyPartMC/
License: GNU General Public License v3.0
hyperlinks are lost due to introduction of the _PyPartMC
we could move everything compiled to PyPartMC.api
... but then docs do not work at all!
here's what is currently reported by the cpplint workflow:
CLANG WARNINGS:
/github/workspace/files/src%2Fpypartmc.cpp:7:10: error: 'pybind11/pybind11.h' file not found [clang-diagnostic-error]
#include "pybind11/pybind11.h"
^~~~~~~~~~~~~~~~~~~~~
/github/workspace/files/src%2Fpypartmc.cpp:22:9: warning: function-like macro 'STRINGIFY' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define STRINGIFY(x) #x
^
/github/workspace/files/src%2Fpypartmc.cpp:23:9: warning: function-like macro 'MACRO_STRINGIFY' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define MACRO_STRINGIFY(x) STRINGIFY(x)
^
/github/workspace/files/src%2Fpypartmc.cpp:27:1: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
PYBIND11_MODULE(_PyPartMC, m) {
^
/github/workspace/files/src%2Fpypartmc.cpp:27:26: warning: all parameters should be named in a function [readability-named-parameter]
PYBIND11_MODULE(_PyPartMC, m) {
^
/*unused*/ /*unused*/
/github/workspace/files/src%2Fpypartmc.cpp:182:10: warning: variable name 'si' is too short, expected at least 3 characters [readability-identifier-length]
auto si = m.def_submodule("si", "SI units");
^
CPPCHECK WARNINGS:
CMakeLists.txt:143:45: error: syntax error [syntaxError]
foreach(target _PyPartMC) # TODO: the same for partmclib
^
PyPartMC%2F__init__.py:5:1: error: syntax error: keyword 'if' is not allowed in global scope [syntaxError]
if (3, 8) <= sys.version_info and platform.system() == 'Windows':
^
clang-tidy-report.txt:14:31: error: Unmatched '{'. Configuration: ''. [syntaxError]
PYBIND11_MODULE(_PyPartMC, m) {
^
setup.py:86:77: error: No pair for character ('). Can't process file. File is either invalid or unicode, which is currently not supported. [syntaxError]
# Specify the arch if using MSVC generator, but only if it doesn't
^
src%2Fpypartmc.cpp:27:0: style: The function 'PYBIND11_MODULE' is never used. [unusedFunction]
^
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingInclude]
Looking at the notebook condense.ipynb, it seems to crash if you change some of the values of kappa. I noticed this as I tried to set the values of kappa to the correct values but was met with some surprise.
Appears to have to do with species that have ions specified. For example:
aero_data = ppmc.AeroData(( {"SO4": [1800 * si.kg/si.m**3, 1, 96.0 * si.g/si.mol, 0.00]}, ))
will work. The following will fail where kappa is set to non-zero:
aero_data = ppmc.AeroData(( {"SO4": [1800 * si.kg/si.m**3, 1, 96.0 * si.g/si.mol, 0.65]}, ))
but if I set the number of ions to 0 and set kappa to .65
aero_data = ppmc.AeroData(( {"SO4": [1800 * si.kg/si.m**3, 0, 96.0 * si.g/si.mol, 0.65]}, ))
will work fine.
probably related: pdoc3/pdoc#318
currently if only non-C++ changes are committed, this is reported in a PR:
CLANG WARNINGS:
error: no input files [clang-diagnostic-error]
error: no such file or directory: '/github/workspace/files/*.cpp' [clang-diagnostic-error]
error: unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error]
CPPCHECK WARNINGS:
clang-tidy-report.txt:3:101: error: syntax error [syntaxError]
error: unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error]
^
pending resolution of pybind/pybind11#3945
Worth adding a note about gcc libs shipped with Matlab, like:
Note that since Matlab ships with and prioritizes its own GCC libraries (
libgfortran.so
,
libstdc++.so
,libgcc_s.so
,libquadmath.so
), it is essential to build PyPartMC
with the [same version of GCC as the one Matlab files are based on](https://www.mathworks.com/matlabcen
ppmc = py.importlib.import_module('PyPartMC');
ver = char(py.getattr(ppmc, "__version__"))
system(['ldd ' char(py.getattr(ppmc, "__file__"))])
%GasState = ppmc.GasState;
%gas_state = GasState();
% ... TODO ()
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.