pressio / pressio4py Goto Github PK
View Code? Open in Web Editor NEWPython bindings to pressio
License: Other
Python bindings to pressio
License: Other
@kennychowdhary
some specific things to figure out:
python setup.py build
I know the build directory is created inside the pressio4py repo. Is. there a way to put the build directory outside the source? I don't like to have builds inside source tree.pip install pressio4py
, where is the build directory created?Hello,
What is the difference between hyper-reduction and masking? Which one is more efficient? I think it is hyper-reduction.
Is there a demo of hyper-reduction available? I'm interested in a demo corresponding to the following link
https://pressio.github.io/pressio4py/html/md_pages_components_rom_lspg_hypred.html
Thanks in advance,
Nachiket
need to automate building and testing for develop branch too
If I modify the Burgers' class so that it exposes the same interface as advection_diffusion1d.py will unsteady_default_lspg_advdiff1d_mlp work out of the box?
The class Burgers1d does not use the same variables as AdvDiff1d, hence the demo crashes.
Is there something else I need to modify/consider?
Thanks,
Nachiket
@kennychowdhary
Now that pressio4py can be installed using pip (see this: https://pypi.org/project/pressio4py/) we need to change the github action commands. To do so, the new action should be updated to include the following steps:
export CXX=path-to-c++-compiler
cd <the-current-branch-to-run-action-on>
cd pressio/; git pull; git checkout develop; cd -
# build pressio4py
python setup.py build
# run unit tests
cd build; pytest; cd -
python setup.py install
# run regression tests
pytest
(2) Also, we need to verify that the build works for several c++ compiler versions.
(3) python3 setup.py sdist bdist_wheel
Is it possible to create masked MLP based ROMs by replacing the linearDecoder
in runMaskedLSPG
from the unsteady_masked_galerkin_vs_lspg_advdiff1d_pod example with a decoder obtained from an autoencoder network? fomInitialState
and romState
will have to be set corrrectly; and finally romState
will have to be decoded correctly and returned. Please let me know if I'm thinking in the correct direction.
Line 47 in advection_diffusion1d.py increments nGrid
by 2
.
Line 167 in main.py creates an advection_diffusion problem with meshSize=200
. So internally AdvDiff1d
is incrementing it to 202
. On line 197 indices 0
and 199
are chosen as the boundary indices. Since there are 202
nodes shouldn't the boundary indices be 0
and 201
instead of 0
and 199
?
Thanks,
Nachiket
this allows us to avoid copying the code, but we need to be able to only select specific lines of a source file
Currently we have a non-scalable way to create regression tests, see the cmakelists inside the tests/regression
.
Need to automate the creation so that we don't add each test individually.
But we need to come up with a convention to name them .
right now seems like only single dof/cell is supported. See this https://github.com/Pressio/pressio4py/blob/main/src/hypred_updater.hpp
Basically, the steps are:
(1) create the demo problem classes following the structure of the burgers1d class already inside the repo.
(2) create a test to test the methods are correct
(3) create a LSPG test to test problem with the full mesh
(4) create a hyper-reduced LSPG
Need to fix logic for logging levels.
info
.PRESSIO_DEBUG_PRINT
and set min level to debug
As the project mentioned, I defined the environment variable CXX
referring to /usr/bin/g++
, but the project raises the following runtime error at the installation process:
RuntimeError: CXX env var missing, needs to point to your target C++ compiler
The error is raised both in the pip install pressio4py
and GitHub source code building commands.
export CXX=$(which g++) && sudo pip3 install pressio4py
export CXX=$(which g++) && sudo pip3 install ./pressio4py # build from souce
Finally, the problem has been solved by editing setup.py
file, adding os.environ['CXX'] = '/usr/bin/g++'
at line 110.
OS: Manjaro,
Python: 3.9,
pip: versions 20 and 21.
Change the wiki instructions to
python3 -m pytest -v -s .
Right now we have to copy the python test files into the same directory as the .so file so we can easily import pressio4py into the python test files. We want to place the test files in the correct subfolders. One option is to add a temporary python path in the beginning of the .py test file so that the python file doesn’t have to be in the same directory as the python .so file. Alternatively, we need to look for a method to somehow temporarily add a path to the python file (similar to the addpath functionality) but using a cmake directive in case we might need to change the directory structure.
Right now, when you build you get this structure (subdirectories are marked with *):
*burgers1d_galerkin
*burgers1d_lspg
burgers1d_sparse_jacobian.py
cmake_install.cmake
CMakeCache.txt
*CMakeFiles
Makefile
pressio4py.cpython-36m-darwin.so
test_burgers1d_galerkin.py
test_burgers1d_lspg.py
test_decoder.py
test_wrapper_module.cpython-36m-darwin.so
test_wrapper.py
*tests
what I would like is to have all tests inside tests
, which means tests
should have the same structure that is has in the source as follows:
tests
/regression
/burgers1d_galerkin
/burgers1d_lapg
/unit
test_decoder.py
test_wrapper.py
test_wrapper_module.cpython-36m-darwin.so
and the top-level build then looks like this:
cmake_install.cmake
CMakeCache.txt
*CMakeFiles
Makefile
pressio4py.cpython-36m-darwin.so
*tests
We need a miniapp, similar to the adv-diffusion, that has multiple fields.
For example we use the adv-diffusion to evolve multiple concentrations.
This is needed to test/show the tensor galerkin formulation.
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.