Skip to content

cosmoBots/pyPORIS_user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyPORIS_user

This repository is a working area for PORIS instrument models. It is meant to be forked by users who want to keep their own models under version control while using the pyPORIS toolchain as a submodule.

Models live under models/. Generated products live under output/:

output/py/    generated Python model classes and editable physical companions
output/xml/   XML files loaded by the Java Swing panel
output/ods/   optional spreadsheet products

The current generation flow is centered on Python: GraphML is parsed into a Python PORIS model, and the XML panel file is generated from that Python model. The direct XML-from-parser path is kept only as an optional comparison tool.

Requirements

  • Python 3
  • Java, for the Swing-based AstroPorisPlayer
  • Python packages from requirements.txt

Recommended setup:

python -m venv .venv
source .venv/bin/activate
pip install --no-cache-dir -r requirements.txt

The dependency constraints are kept in constraints.txt because some parser dependencies have had breaking changes.

On Debian/Ubuntu-like systems, a suitable Java installation is:

sudo apt install openjdk-17-jdk

First Checkout

After cloning or forking the repository, initialize the submodule:

git submodule update --init --recursive

This populates pyPORIS/ and the bundled AstroPorisPlayer binaries.

Quick Start

Open a generated panel for a single GraphML model:

pyPORIS/porispanel.sh nrt/mainaxis

The model argument is the path below models/, without the .graphml extension. The command above reads:

models/nrt/mainaxis.graphml

and produces:

output/py/mainaxis/mainaxis/mainaxisPORIS.py
output/xml/nrt/mainaxis.xml

To generate without opening the panel:

pyPORIS/porispanel.sh --no-panel nrt/mainaxis

To also write the ODS spreadsheet product:

pyPORIS/porispanel.sh --ods nrt/mainaxis

ODS generation is opt-in so normal validation runs do not rewrite spreadsheet products unnecessarily.

User Guide

For the normal modeling workflows, see:

docs/user-guide.md

That guide covers:

  • single-file models
  • directory/supramodel models
  • XML generation from Python
  • optional parser XML comparison
  • visual validation of all panels
  • generated Python and editable physical code

Main Commands

Single GraphML model:

pyPORIS/porispanel.sh [--ods] [--parser-xml] [--no-panel] <model>

Fragmented directory model:

pyPORIS/porispanel_dir.sh [--ods] [--parser-xml] [--no-panel] <model-dir>

cosmoSys variants:

pyPORIS/porispanel_csys.sh <model>
pyPORIS/porispanel_dir_csys.sh <model-dir>

Open an existing XML directly:

pyPORIS/xmlporispanel.sh output/xml/nrt/mainaxis.xml

Generate or run the Python physical model:

pyPORIS/doPorisPython.sh nrt/mainaxis
pyPORIS/runPorisModel.sh nrt/mainaxis

Run a visual validation pass over all known panels:

pyPORIS/test_porispanels.sh

Close each AstroPorisPlayer window to continue with the next model.

Updating pyPORIS

pyPORIS/ is a git submodule pinned by this repository. To update it manually:

cd pyPORIS
git fetch --all
git checkout main
git pull
cd ..
git add pyPORIS
git commit -m "Update pyPORIS submodule"

Toolchain behavior can change over time, so validate the generated products after moving the submodule.

Notes

The models/ directory should contain source models only. Generated Python, XML and ODS products should be kept under output/.

Happy modeling!

cosmoBots.eu

About

An example of how to use pyPORIS to model your own instruments

Resources

License

Stars

1 star

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages