jneqsim 3.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jneqsim-3.2.0/LICENSE +21 -0
- jneqsim-3.2.0/PKG-INFO +121 -0
- jneqsim-3.2.0/README.md +94 -0
- jneqsim-3.2.0/docs/demo.gif +0 -0
- jneqsim-3.2.0/jneqsim/__init__.py +3 -0
- jneqsim-3.2.0/jneqsim/__init__.pyi +1 -0
- jneqsim-3.2.0/jneqsim/common/config.yaml +36 -0
- jneqsim-3.2.0/jneqsim/common/load_config.py +9 -0
- jneqsim-3.2.0/jneqsim/common/setup_logging.py +16 -0
- jneqsim-3.2.0/jneqsim/dependency_manager.py +184 -0
- jneqsim-3.2.0/jneqsim/jar_cache.py +115 -0
- jneqsim-3.2.0/jneqsim/jvm_service.py +68 -0
- jneqsim-3.2.0/jneqsim/neqsim/__init__.pyi +43 -0
- jneqsim-3.2.0/jneqsim/neqsim/api/__init__.pyi +15 -0
- jneqsim-3.2.0/jneqsim/neqsim/api/ioc/__init__.pyi +25 -0
- jneqsim-3.2.0/jneqsim/neqsim/blackoil/__init__.pyi +113 -0
- jneqsim-3.2.0/jneqsim/neqsim/blackoil/io/__init__.pyi +173 -0
- jneqsim-3.2.0/jneqsim/neqsim/chemicalreactions/__init__.pyi +63 -0
- jneqsim-3.2.0/jneqsim/neqsim/chemicalreactions/chemicalequilibrium/__init__.pyi +82 -0
- jneqsim-3.2.0/jneqsim/neqsim/chemicalreactions/chemicalreaction/__init__.pyi +89 -0
- jneqsim-3.2.0/jneqsim/neqsim/chemicalreactions/kinetics/__init__.pyi +27 -0
- jneqsim-3.2.0/jneqsim/neqsim/datapresentation/__init__.pyi +42 -0
- jneqsim-3.2.0/jneqsim/neqsim/datapresentation/filehandling/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/datapresentation/jfreechart/__init__.pyi +40 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/__init__.pyi +31 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowleg/__init__.pyi +62 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowleg/pipeleg/__init__.pyi +25 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/__init__.pyi +395 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/__init__.pyi +175 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/equilibriumfluidboundary/__init__.pyi +31 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/__init__.pyi +19 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarynode/__init__.pyi +32 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarynode/fluidboundarynonreactivenode/__init__.pyi +24 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarynode/fluidboundaryreactivenode/__init__.pyi +24 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarysolver/__init__.pyi +38 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarysolver/fluidboundaryreactivesolver/__init__.pyi +20 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarysystem/__init__.pyi +51 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarysystem/fluidboundarynonreactive/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/finitevolumeboundary/fluidboundarysystem/fluidboundarysystemreactive/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/__init__.pyi +45 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/__init__.pyi +46 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/reactivefilmmodel/__init__.pyi +55 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/reactivefilmmodel/enhancementfactor/__init__.pyi +61 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/__init__.pyi +54 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/interphaseonephase/__init__.pyi +26 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/interphaseonephase/interphasepipeflow/__init__.pyi +33 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/interphasetwophase/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/interphasetwophase/interphasepipeflow/__init__.pyi +103 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/interphasetwophase/interphasereactorflow/__init__.pyi +44 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/fluidboundary/interphasetransportcoefficient/interphasetwophase/stirredcell/__init__.pyi +31 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/multiphasenode/__init__.pyi +42 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/multiphasenode/waxnode/__init__.pyi +37 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/onephasenode/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/onephasenode/onephasepipeflownode/__init__.pyi +31 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/twophasenode/__init__.pyi +67 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/twophasenode/twophasepipeflownode/__init__.pyi +113 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/twophasenode/twophasereactorflownode/__init__.pyi +59 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flownode/twophasenode/twophasestirredcellnode/__init__.pyi +56 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsolver/__init__.pyi +89 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsolver/onephaseflowsolver/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsolver/onephaseflowsolver/onephasepipeflowsolver/__init__.pyi +46 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsolver/twophaseflowsolver/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsolver/twophaseflowsolver/stirredcellsolver/__init__.pyi +39 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsolver/twophaseflowsolver/twophasepipeflowsolver/__init__.pyi +93 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/__init__.pyi +135 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/onephaseflowsystem/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/onephaseflowsystem/pipeflowsystem/__init__.pyi +50 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/twophaseflowsystem/__init__.pyi +34 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/twophaseflowsystem/shipsystem/__init__.pyi +64 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/twophaseflowsystem/stirredcellsystem/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/twophaseflowsystem/twophasepipeflowsystem/__init__.pyi +292 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/flowsystem/twophaseflowsystem/twophasereactorflowsystem/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/__init__.pyi +106 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/internalgeometry/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/internalgeometry/packings/__init__.pyi +54 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/internalgeometry/wall/__init__.pyi +195 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/pipe/__init__.pyi +49 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/reactor/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/stirredcell/__init__.pyi +26 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/geometrydefinitions/surrounding/__init__.pyi +74 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/__init__.pyi +64 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flownodevisualization/__init__.pyi +74 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flownodevisualization/onephaseflownodevisualization/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flownodevisualization/onephaseflownodevisualization/onephasepipeflownodevisualization/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flownodevisualization/twophaseflownodevisualization/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flowsystemvisualization/__init__.pyi +43 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flowsystemvisualization/onephaseflowvisualization/__init__.pyi +25 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flowsystemvisualization/onephaseflowvisualization/pipeflowvisualization/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flowsystemvisualization/twophaseflowvisualization/__init__.pyi +25 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/fluidmechanicsvisualization/flowsystemvisualization/twophaseflowvisualization/twophasepipeflowvisualization/__init__.pyi +33 -0
- jneqsim-3.2.0/jneqsim/neqsim/fluidmechanics/util/timeseries/__init__.pyi +61 -0
- jneqsim-3.2.0/jneqsim/neqsim/integration/__init__.pyi +143 -0
- jneqsim-3.2.0/jneqsim/neqsim/mathlib/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/mathlib/generalmath/__init__.pyi +21 -0
- jneqsim-3.2.0/jneqsim/neqsim/mathlib/nonlinearsolver/__init__.pyi +66 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/__init__.pyi +52 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/interfaceproperties/__init__.pyi +79 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/interfaceproperties/solidadsorption/__init__.pyi +41 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/interfaceproperties/surfacetension/__init__.pyi +132 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/__init__.pyi +40 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/commonphasephysicalproperties/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/commonphasephysicalproperties/conductivity/__init__.pyi +38 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/commonphasephysicalproperties/diffusivity/__init__.pyi +34 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/commonphasephysicalproperties/viscosity/__init__.pyi +116 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/gasphysicalproperties/__init__.pyi +33 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/gasphysicalproperties/conductivity/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/gasphysicalproperties/density/__init__.pyi +24 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/gasphysicalproperties/diffusivity/__init__.pyi +36 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/gasphysicalproperties/viscosity/__init__.pyi +34 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/liquidphysicalproperties/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/liquidphysicalproperties/conductivity/__init__.pyi +26 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/liquidphysicalproperties/density/__init__.pyi +38 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/liquidphysicalproperties/diffusivity/__init__.pyi +101 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/liquidphysicalproperties/viscosity/__init__.pyi +39 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/methodinterface/__init__.pyi +43 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/solidphysicalproperties/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/solidphysicalproperties/conductivity/__init__.pyi +24 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/solidphysicalproperties/density/__init__.pyi +24 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/solidphysicalproperties/diffusivity/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/methods/solidphysicalproperties/viscosity/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/mixingrule/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/system/__init__.pyi +116 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/system/commonphasephysicalproperties/__init__.pyi +21 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/system/gasphysicalproperties/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/system/liquidphysicalproperties/__init__.pyi +43 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/system/solidphysicalproperties/__init__.pyi +21 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/__init__.pyi +15 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/parameterfitting/__init__.pyi +15 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/parameterfitting/purecomponentparameterfitting/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/parameterfitting/purecomponentparameterfitting/purecompinterfacetension/__init__.pyi +33 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/parameterfitting/purecomponentparameterfitting/purecompviscosity/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/parameterfitting/purecomponentparameterfitting/purecompviscosity/chungmethod/__init__.pyi +33 -0
- jneqsim-3.2.0/jneqsim/neqsim/physicalproperties/util/parameterfitting/purecomponentparameterfitting/purecompviscosity/linearliquidmodel/__init__.pyi +33 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/__init__.pyi +96 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/advisory/__init__.pyi +99 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/alarm/__init__.pyi +187 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/calibration/__init__.pyi +297 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/conditionmonitor/__init__.pyi +37 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/controllerdevice/__init__.pyi +308 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/controllerdevice/structure/__init__.pyi +51 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/costestimation/__init__.pyi +45 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/costestimation/compressor/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/costestimation/separator/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/costestimation/valve/__init__.pyi +22 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/__init__.pyi +313 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/absorber/__init__.pyi +144 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/adsorber/__init__.pyi +55 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/battery/__init__.pyi +38 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/blackoil/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/compressor/__init__.pyi +560 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/diffpressure/__init__.pyi +71 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/distillation/__init__.pyi +205 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/ejector/__init__.pyi +85 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/electrolyzer/__init__.pyi +64 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/expander/__init__.pyi +152 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/filter/__init__.pyi +44 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/flare/__init__.pyi +146 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/flare/dto/__init__.pyi +59 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/heatexchanger/__init__.pyi +466 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/manifold/__init__.pyi +43 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/membrane/__init__.pyi +47 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/mixer/__init__.pyi +107 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/network/__init__.pyi +122 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/pipeline/__init__.pyi +683 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/pipeline/twophasepipe/__init__.pyi +696 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/pipeline/twophasepipe/closure/__init__.pyi +69 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/pipeline/twophasepipe/numerics/__init__.pyi +141 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/powergeneration/__init__.pyi +101 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/pump/__init__.pyi +246 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/reactor/__init__.pyi +180 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/reservoir/__init__.pyi +329 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/separator/__init__.pyi +273 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/separator/sectiontype/__init__.pyi +73 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/splitter/__init__.pyi +91 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/stream/__init__.pyi +259 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/subsea/__init__.pyi +48 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/tank/__init__.pyi +287 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/util/__init__.pyi +507 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/valve/__init__.pyi +550 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/well/__init__.pyi +15 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/equipment/well/allocation/__init__.pyi +89 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/fielddevelopment/__init__.pyi +21 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/fielddevelopment/concept/__init__.pyi +282 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/fielddevelopment/evaluation/__init__.pyi +132 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/fielddevelopment/facility/__init__.pyi +133 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/fielddevelopment/screening/__init__.pyi +209 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/integration/__init__.pyi +15 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/integration/ml/__init__.pyi +85 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/__init__.pyi +82 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/action/__init__.pyi +122 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/condition/__init__.pyi +69 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/control/__init__.pyi +41 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/esd/__init__.pyi +37 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/hipps/__init__.pyi +46 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/shutdown/__init__.pyi +44 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/sis/__init__.pyi +119 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/startup/__init__.pyi +41 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/logic/voting/__init__.pyi +54 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/measurementdevice/__init__.pyi +454 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/measurementdevice/online/__init__.pyi +27 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/measurementdevice/simpleflowregime/__init__.pyi +92 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/measurementdevice/vfm/__init__.pyi +169 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/__init__.pyi +238 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/absorber/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/adsorber/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/compressor/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/data/__init__.pyi +34 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/designstandards/__init__.pyi +132 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/ejector/__init__.pyi +46 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/heatexchanger/__init__.pyi +118 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/pipeline/__init__.pyi +123 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/separator/__init__.pyi +34 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/separator/sectiontype/__init__.pyi +59 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mechanicaldesign/valve/__init__.pyi +221 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/ml/__init__.pyi +279 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/ml/controllers/__init__.pyi +54 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/ml/examples/__init__.pyi +60 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/ml/multiagent/__init__.pyi +117 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/ml/surrogate/__init__.pyi +95 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/mpc/__init__.pyi +663 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/processmodel/__init__.pyi +569 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/processmodel/graph/__init__.pyi +212 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/processmodel/lifecycle/__init__.pyi +153 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/processmodel/processmodules/__init__.pyi +222 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/safety/__init__.pyi +200 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/safety/dto/__init__.pyi +43 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/safety/envelope/__init__.pyi +75 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/safety/release/__init__.pyi +95 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/safety/risk/__init__.pyi +148 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/safety/scenario/__init__.pyi +99 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/streaming/__init__.pyi +94 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/sustainability/__init__.pyi +84 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/event/__init__.pyi +114 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/example/__init__.pyi +131 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/export/__init__.pyi +79 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/fielddevelopment/__init__.pyi +362 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/fire/__init__.pyi +186 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/monitor/__init__.pyi +370 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/optimization/__init__.pyi +318 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/report/__init__.pyi +64 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/report/safety/__init__.pyi +109 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/scenario/__init__.pyi +86 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/sensitivity/__init__.pyi +47 -0
- jneqsim-3.2.0/jneqsim/neqsim/process/util/uncertainty/__init__.pyi +87 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/__init__.pyi +25 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/flowassurance/__init__.pyi +108 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/modeltuning/__init__.pyi +40 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/regression/__init__.pyi +223 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/reservoirproperties/__init__.pyi +23 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/simulation/__init__.pyi +346 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/util/__init__.pyi +324 -0
- jneqsim-3.2.0/jneqsim/neqsim/pvtsimulation/util/parameterfitting/__init__.pyi +168 -0
- jneqsim-3.2.0/jneqsim/neqsim/standards/__init__.pyi +74 -0
- jneqsim-3.2.0/jneqsim/neqsim/standards/gasquality/__init__.pyi +162 -0
- jneqsim-3.2.0/jneqsim/neqsim/standards/oilquality/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/standards/salescontract/__init__.pyi +87 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/__init__.pyi +23 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/dataanalysis/__init__.pyi +15 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/dataanalysis/datasmoothing/__init__.pyi +24 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalequipmentdata/__init__.pyi +21 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalequipmentdata/wettedwallcolumndata/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalsamplecreation/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalsamplecreation/readdatafromfile/__init__.pyi +42 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalsamplecreation/readdatafromfile/wettedwallcolumnreader/__init__.pyi +52 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalsamplecreation/samplecreator/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/experimentalsamplecreation/samplecreator/wettedwallcolumnsamplecreator/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/montecarlosimulation/__init__.pyi +28 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/parameterfitting/__init__.pyi +173 -0
- jneqsim-3.2.0/jneqsim/neqsim/statistics/parameterfitting/nonlinearparameterfitting/__init__.pyi +60 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/__init__.pyi +108 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/atomelement/__init__.pyi +85 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/characterization/__init__.pyi +634 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/component/__init__.pyi +1947 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/component/attractiveeosterm/__init__.pyi +308 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/component/repulsiveeosterm/__init__.pyi +18 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/mixingrule/__init__.pyi +456 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/phase/__init__.pyi +3131 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/system/__init__.pyi +1652 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/Vega/__init__.pyi +55 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/__init__.pyi +83 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/benchmark/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/constants/__init__.pyi +148 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/derivatives/__init__.pyi +114 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/empiric/__init__.pyi +44 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/gerg/__init__.pyi +183 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/humidair/__init__.pyi +30 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/jni/__init__.pyi +53 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/leachman/__init__.pyi +58 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/readwrite/__init__.pyi +70 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/referenceequations/__init__.pyi +41 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/spanwagner/__init__.pyi +21 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermo/util/steam/__init__.pyi +36 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/__init__.pyi +245 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/chemicalequilibrium/__init__.pyi +29 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/flashops/__init__.pyi +491 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/flashops/saturationops/__init__.pyi +353 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/phaseenvelopeops/__init__.pyi +17 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/phaseenvelopeops/multicomponentenvelopeops/__init__.pyi +203 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/phaseenvelopeops/reactivecurves/__init__.pyi +48 -0
- jneqsim-3.2.0/jneqsim/neqsim/thermodynamicoperations/propertygenerator/__init__.pyi +130 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/__init__.pyi +112 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/annotation/__init__.pyi +73 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/database/__init__.pyi +180 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/exception/__init__.pyi +82 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/generator/__init__.pyi +25 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/serialization/__init__.pyi +32 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/unit/__init__.pyi +131 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/util/__init__.pyi +35 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/validation/__init__.pyi +132 -0
- jneqsim-3.2.0/jneqsim/neqsim/util/validation/contracts/__init__.pyi +71 -0
- jneqsim-3.2.0/jneqsim/py.typed +0 -0
- jneqsim-3.2.0/pyproject.toml +65 -0
jneqsim-3.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Equinor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
jneqsim-3.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jneqsim
|
|
3
|
+
Version: 3.2.0
|
|
4
|
+
Summary: Python bindings for the Java library NeqSim (via JPype), with python stubs
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: neqsim
|
|
8
|
+
Author: Jørgen
|
|
9
|
+
Author-email: jenge@equinor.com
|
|
10
|
+
Maintainer: Mathias
|
|
11
|
+
Maintainer-email: maohe@equinor.com
|
|
12
|
+
Requires-Python: >=3.9,<4.0
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Requires-Dist: JPype1 (>=1.5.0,<2.0.0)
|
|
22
|
+
Requires-Dist: PyYAML (>=6.0,<7.0)
|
|
23
|
+
Project-URL: Homepage, https://github.com/equinor/jneqsim
|
|
24
|
+
Project-URL: Repository, https://github.com/equinor/jneqsim
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# jNeqSim
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/jneqsim/)
|
|
30
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Python interface for the [NeqSim java package](https://equinor.github.io/neqsimhome/), with stubs. Java interface is created with [jpype](https://jpype.readthedocs.io/en/latest/index.html#), and stubs are generated with [stubgenj](https://gitlab.cern.ch/scripting-tools/stubgenj)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## PYPI
|
|
37
|
+
|
|
38
|
+
[https://pypi.org/project/jneqsim/](https://pypi.org/project/jneqsim/)
|
|
39
|
+
> [!NOTE]
|
|
40
|
+
> JNeqSim mirrors NeqSims versions
|
|
41
|
+
|
|
42
|
+
## Demo
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Example
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from jneqsim import neqsim
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def pressurize_gas():
|
|
54
|
+
inlet_fluid = neqsim.thermo.system.SystemSrkEos()
|
|
55
|
+
neqsim.thermo.system.SystemSrkEos()
|
|
56
|
+
thermo_ops = neqsim.thermodynamicOperations.ThermodynamicOperations(inlet_fluid)
|
|
57
|
+
inlet_fluid.addComponent("methane", 100.0)
|
|
58
|
+
|
|
59
|
+
inlet_fluid.setTemperature(10, "C")
|
|
60
|
+
inlet_fluid.setPressure(20, "bara")
|
|
61
|
+
inlet_fluid.setMultiPhaseCheck(True)
|
|
62
|
+
inlet_fluid.setSolidPhaseCheck("methane")
|
|
63
|
+
|
|
64
|
+
thermo_ops.TPflash()
|
|
65
|
+
thermo_ops.bubblePointTemperatureFlash()
|
|
66
|
+
|
|
67
|
+
inlet_fluid.initProperties()
|
|
68
|
+
enthalpy = inlet_fluid.getEnthalpy()
|
|
69
|
+
|
|
70
|
+
inlet_fluid.setPressure(1.0, "bara")
|
|
71
|
+
thermo_ops.PHflash(enthalpy)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Dependencies
|
|
75
|
+
|
|
76
|
+
- [jpype](https://jpype.readthedocs.io/en/latest/index.html#)
|
|
77
|
+
|
|
78
|
+
## Version Management
|
|
79
|
+
|
|
80
|
+
jneqsim uses a controlled release process to ensure compatibility:
|
|
81
|
+
|
|
82
|
+
- **Pinned Versions**: Each jneqsim release is pinned to a specific, tested NeqSim JAR version
|
|
83
|
+
- **Automated Updates**: The nightly CI workflow automatically checks for new NeqSim releases and publishes updated jneqsim packages when available
|
|
84
|
+
- **No Auto-Updates**: Applications using jneqsim will not automatically download newer NeqSim versions - they use the tested version that comes with their installed jneqsim package
|
|
85
|
+
- **Cache Management**: Downloaded JARs are cached locally in `~/.jneqsim/cache` for faster subsequent usage
|
|
86
|
+
|
|
87
|
+
## Development
|
|
88
|
+
|
|
89
|
+
### Running Tests
|
|
90
|
+
|
|
91
|
+
The project uses pytest with custom markers to categorize tests. Test dependencies are already included in the development dependencies.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Install development dependencies (includes pytest and pytest-mock)
|
|
95
|
+
poetry install
|
|
96
|
+
|
|
97
|
+
# Run unit tests (fast, excludes tests marked as slow)
|
|
98
|
+
pytest -v -m "not slow" tests/
|
|
99
|
+
|
|
100
|
+
# Run all tests (may download JARs for integration tests)
|
|
101
|
+
pytest -v tests/
|
|
102
|
+
|
|
103
|
+
# Run with coverage (requires pytest-cov)
|
|
104
|
+
poetry add --group dev pytest-cov
|
|
105
|
+
poetry run pytest --cov=jneqsim --cov-report=html tests/
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Test markers:**
|
|
109
|
+
- `slow`: Tests that may download files or take longer to run
|
|
110
|
+
- `integration`: Integration tests that require external dependencies
|
|
111
|
+
- `unit`: Fast unit tests (default)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<a id="Contributing"></a>
|
|
115
|
+
|
|
116
|
+
## :+1: Contributing
|
|
117
|
+
|
|
118
|
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
119
|
+
|
|
120
|
+
Please make sure to update tests as appropriate.
|
|
121
|
+
|
jneqsim-3.2.0/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# jNeqSim
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/jneqsim/)
|
|
4
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Python interface for the [NeqSim java package](https://equinor.github.io/neqsimhome/), with stubs. Java interface is created with [jpype](https://jpype.readthedocs.io/en/latest/index.html#), and stubs are generated with [stubgenj](https://gitlab.cern.ch/scripting-tools/stubgenj)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## PYPI
|
|
11
|
+
|
|
12
|
+
[https://pypi.org/project/jneqsim/](https://pypi.org/project/jneqsim/)
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> JNeqSim mirrors NeqSims versions
|
|
15
|
+
|
|
16
|
+
## Demo
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from jneqsim import neqsim
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def pressurize_gas():
|
|
28
|
+
inlet_fluid = neqsim.thermo.system.SystemSrkEos()
|
|
29
|
+
neqsim.thermo.system.SystemSrkEos()
|
|
30
|
+
thermo_ops = neqsim.thermodynamicOperations.ThermodynamicOperations(inlet_fluid)
|
|
31
|
+
inlet_fluid.addComponent("methane", 100.0)
|
|
32
|
+
|
|
33
|
+
inlet_fluid.setTemperature(10, "C")
|
|
34
|
+
inlet_fluid.setPressure(20, "bara")
|
|
35
|
+
inlet_fluid.setMultiPhaseCheck(True)
|
|
36
|
+
inlet_fluid.setSolidPhaseCheck("methane")
|
|
37
|
+
|
|
38
|
+
thermo_ops.TPflash()
|
|
39
|
+
thermo_ops.bubblePointTemperatureFlash()
|
|
40
|
+
|
|
41
|
+
inlet_fluid.initProperties()
|
|
42
|
+
enthalpy = inlet_fluid.getEnthalpy()
|
|
43
|
+
|
|
44
|
+
inlet_fluid.setPressure(1.0, "bara")
|
|
45
|
+
thermo_ops.PHflash(enthalpy)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Dependencies
|
|
49
|
+
|
|
50
|
+
- [jpype](https://jpype.readthedocs.io/en/latest/index.html#)
|
|
51
|
+
|
|
52
|
+
## Version Management
|
|
53
|
+
|
|
54
|
+
jneqsim uses a controlled release process to ensure compatibility:
|
|
55
|
+
|
|
56
|
+
- **Pinned Versions**: Each jneqsim release is pinned to a specific, tested NeqSim JAR version
|
|
57
|
+
- **Automated Updates**: The nightly CI workflow automatically checks for new NeqSim releases and publishes updated jneqsim packages when available
|
|
58
|
+
- **No Auto-Updates**: Applications using jneqsim will not automatically download newer NeqSim versions - they use the tested version that comes with their installed jneqsim package
|
|
59
|
+
- **Cache Management**: Downloaded JARs are cached locally in `~/.jneqsim/cache` for faster subsequent usage
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
### Running Tests
|
|
64
|
+
|
|
65
|
+
The project uses pytest with custom markers to categorize tests. Test dependencies are already included in the development dependencies.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Install development dependencies (includes pytest and pytest-mock)
|
|
69
|
+
poetry install
|
|
70
|
+
|
|
71
|
+
# Run unit tests (fast, excludes tests marked as slow)
|
|
72
|
+
pytest -v -m "not slow" tests/
|
|
73
|
+
|
|
74
|
+
# Run all tests (may download JARs for integration tests)
|
|
75
|
+
pytest -v tests/
|
|
76
|
+
|
|
77
|
+
# Run with coverage (requires pytest-cov)
|
|
78
|
+
poetry add --group dev pytest-cov
|
|
79
|
+
poetry run pytest --cov=jneqsim --cov-report=html tests/
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Test markers:**
|
|
83
|
+
- `slow`: Tests that may download files or take longer to run
|
|
84
|
+
- `integration`: Integration tests that require external dependencies
|
|
85
|
+
- `unit`: Fast unit tests (default)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
<a id="Contributing"></a>
|
|
89
|
+
|
|
90
|
+
## :+1: Contributing
|
|
91
|
+
|
|
92
|
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
93
|
+
|
|
94
|
+
Please make sure to update tests as appropriate.
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from jneqsim.neqsim import * # noqa: F403
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# NeqSim Dependency Configuration
|
|
2
|
+
# This file defines how to resolve NeqSim Java dependencies
|
|
3
|
+
|
|
4
|
+
neqsim:
|
|
5
|
+
# Version to use (specific version that has been tested with this jneqsim release)
|
|
6
|
+
# This version is automatically updated by the CI/CD pipeline when a new NeqSim release is published
|
|
7
|
+
version: "3.2.0"
|
|
8
|
+
|
|
9
|
+
# Fallback version when GitHub API is unavailable (rate limited, network issues)
|
|
10
|
+
# This should be the previous tested version, providing a safety fallback mechanism
|
|
11
|
+
# The CI/CD pipeline automatically sets this to the previous version when updating
|
|
12
|
+
fallback_version: "3.0.43"
|
|
13
|
+
|
|
14
|
+
# GitHub Releases source
|
|
15
|
+
sources:
|
|
16
|
+
github:
|
|
17
|
+
enabled: true
|
|
18
|
+
repository: "equinor/neqsim"
|
|
19
|
+
base_url: "https://github.com/equinor/neqsim/releases/download"
|
|
20
|
+
# JAR file patterns for different Java versions
|
|
21
|
+
# Note: The code will try multiple naming patterns per Java version
|
|
22
|
+
# (e.g., Java21-Java21, Java21) to handle variations
|
|
23
|
+
assets:
|
|
24
|
+
java8: "neqsim-{version}-Java8.jar"
|
|
25
|
+
java11: "neqsim-{version}.jar" # Java 11+ version
|
|
26
|
+
java21: "neqsim-{version}-Java21.jar"
|
|
27
|
+
|
|
28
|
+
# Logging configuration
|
|
29
|
+
logging:
|
|
30
|
+
level: "WARNING" # DEBUG, INFO, WARNING, ERROR
|
|
31
|
+
show_progress: true
|
|
32
|
+
|
|
33
|
+
# Cache stores one JAR file per version/Java version combination
|
|
34
|
+
cache:
|
|
35
|
+
enabled: true
|
|
36
|
+
verify_integrity: true
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def setup_logging(config: dict) -> logging.Logger:
|
|
5
|
+
"""Setup logging based on configuration"""
|
|
6
|
+
logger = logging.getLogger(__name__)
|
|
7
|
+
level = getattr(logging, config["logging"]["level"])
|
|
8
|
+
logger.setLevel(level)
|
|
9
|
+
|
|
10
|
+
if not logger.handlers:
|
|
11
|
+
handler = logging.StreamHandler()
|
|
12
|
+
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
13
|
+
handler.setFormatter(formatter)
|
|
14
|
+
logger.addHandler(handler)
|
|
15
|
+
|
|
16
|
+
return logger
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import tempfile
|
|
3
|
+
import urllib.error
|
|
4
|
+
import urllib.request
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
from .jar_cache import JARCacheManager
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class NeqSimDependencyManager:
|
|
12
|
+
"""Manages NeqSim JAR dependencies from GitHub releases"""
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self, logger: logging.Logger | None = None, config: dict | None = None, cache_dir: Optional[Path] = None
|
|
16
|
+
):
|
|
17
|
+
"""Initialize Neqsim Dependency Manager
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
logger (logging.Logger | None): Logger instance for logging or None
|
|
21
|
+
config (dict | None): Configuration dictionary (from yaml) or None
|
|
22
|
+
cache_dir (Optional[Path], optional): Directory for caching JAR versions, defaults to ~/.jneqsim/cache
|
|
23
|
+
"""
|
|
24
|
+
if cache_dir is None:
|
|
25
|
+
cache_dir = Path.home() / ".jneqsim" / "cache"
|
|
26
|
+
|
|
27
|
+
self.cache_dir = cache_dir
|
|
28
|
+
self.cache_dir.mkdir(parents=True, exist_ok=True)
|
|
29
|
+
|
|
30
|
+
if config is None:
|
|
31
|
+
from jneqsim.common.load_config import load_config
|
|
32
|
+
|
|
33
|
+
config_path = Path(__file__).parent / "common" / "config.yaml"
|
|
34
|
+
config = load_config(config_path)
|
|
35
|
+
self.config = config
|
|
36
|
+
if logger is None:
|
|
37
|
+
from jneqsim.common.setup_logging import setup_logging
|
|
38
|
+
|
|
39
|
+
logger = setup_logging(self.config)
|
|
40
|
+
self.logger = logger
|
|
41
|
+
|
|
42
|
+
# Initialize cache manager
|
|
43
|
+
self.cache_manager = JARCacheManager(self.cache_dir, self.config, self.logger)
|
|
44
|
+
|
|
45
|
+
def _get_jar_patterns(self, java_version: int) -> list[str]:
|
|
46
|
+
"""Get list of JAR filename patterns to try for a given Java version.
|
|
47
|
+
|
|
48
|
+
Returns patterns in order of preference, with newer patterns first.
|
|
49
|
+
Some releases use varying naming patterns (e.g., Java21-Java21 vs Java21).
|
|
50
|
+
"""
|
|
51
|
+
github_config = self.config["neqsim"]["sources"]["github"]
|
|
52
|
+
|
|
53
|
+
if java_version == 8:
|
|
54
|
+
return [
|
|
55
|
+
"neqsim-{version}-Java8-Java8.jar", # Newer pattern
|
|
56
|
+
github_config["assets"]["java8"], # Standard pattern
|
|
57
|
+
]
|
|
58
|
+
elif 11 <= java_version < 21:
|
|
59
|
+
return [
|
|
60
|
+
"neqsim-{version}.jar", # Standard pattern
|
|
61
|
+
]
|
|
62
|
+
elif java_version >= 21:
|
|
63
|
+
return [
|
|
64
|
+
"neqsim-{version}-Java21-Java21.jar", # Newer pattern
|
|
65
|
+
github_config["assets"]["java21"], # Standard pattern
|
|
66
|
+
]
|
|
67
|
+
else:
|
|
68
|
+
raise ValueError(f"Unsupported Java version: {java_version}")
|
|
69
|
+
|
|
70
|
+
def _get_jar_from_github(self, version: str, java_version: int) -> Path:
|
|
71
|
+
"""Download JAR from GitHub releases with fallback support and caching"""
|
|
72
|
+
github_config = self.config["neqsim"]["sources"]["github"]
|
|
73
|
+
|
|
74
|
+
# Check cache first
|
|
75
|
+
cached_jar = self.cache_manager.get_cached_jar(version, java_version)
|
|
76
|
+
if cached_jar:
|
|
77
|
+
return cached_jar
|
|
78
|
+
|
|
79
|
+
patterns_to_try = self._get_jar_patterns(java_version)
|
|
80
|
+
|
|
81
|
+
# Try each pattern until one succeeds
|
|
82
|
+
final_error = None
|
|
83
|
+
for i, asset_pattern in enumerate(patterns_to_try):
|
|
84
|
+
jar_filename = asset_pattern.format(version=version)
|
|
85
|
+
url = f"{github_config['base_url']}/v{version}/{jar_filename}"
|
|
86
|
+
|
|
87
|
+
# Create temporary directory for download
|
|
88
|
+
with tempfile.TemporaryDirectory(prefix="jneqsim_") as temp_dir_str:
|
|
89
|
+
temp_dir = Path(temp_dir_str)
|
|
90
|
+
downloaded_jar = temp_dir / jar_filename
|
|
91
|
+
|
|
92
|
+
try:
|
|
93
|
+
is_fallback = i > 0
|
|
94
|
+
if self.config["logging"]["show_progress"]:
|
|
95
|
+
if is_fallback:
|
|
96
|
+
self.logger.info(f"Trying fallback: {jar_filename} for Java {java_version}...")
|
|
97
|
+
else:
|
|
98
|
+
self.logger.info(f"Downloading {jar_filename} for Java {java_version}...")
|
|
99
|
+
|
|
100
|
+
with urllib.request.urlopen(url) as response: # noqa: S310
|
|
101
|
+
content = response.read()
|
|
102
|
+
|
|
103
|
+
downloaded_jar.write_bytes(content)
|
|
104
|
+
|
|
105
|
+
if is_fallback:
|
|
106
|
+
self.logger.warning(
|
|
107
|
+
f"Using fallback JAR '{jar_filename}' for Java {java_version}. "
|
|
108
|
+
f"Java {java_version}-specific version not available."
|
|
109
|
+
)
|
|
110
|
+
else:
|
|
111
|
+
self.logger.info(f"Downloaded from GitHub: {downloaded_jar.name}")
|
|
112
|
+
|
|
113
|
+
# Cache the downloaded JAR
|
|
114
|
+
try:
|
|
115
|
+
cached_jar = self.cache_manager.cache_jar(downloaded_jar, version, java_version)
|
|
116
|
+
except Exception as cache_exc:
|
|
117
|
+
final_error = cache_exc
|
|
118
|
+
self.logger.error(f"Failed to cache downloaded JAR: {cache_exc}")
|
|
119
|
+
# Try fallback if available
|
|
120
|
+
continue
|
|
121
|
+
return cached_jar
|
|
122
|
+
|
|
123
|
+
except urllib.error.HTTPError as e:
|
|
124
|
+
if e.code == 404:
|
|
125
|
+
final_error = e
|
|
126
|
+
self.logger.debug(f"JAR not found: {jar_filename} (trying fallback...)")
|
|
127
|
+
continue # Try next pattern
|
|
128
|
+
else:
|
|
129
|
+
# For other HTTP errors, fail immediately
|
|
130
|
+
self.logger.error(f"HTTP error downloading from GitHub: {e}")
|
|
131
|
+
raise RuntimeError(f"Could not download NeqSim from GitHub: {e}") from e
|
|
132
|
+
except Exception as e:
|
|
133
|
+
final_error = e
|
|
134
|
+
self.logger.error(f"Failed to download from GitHub: {e}")
|
|
135
|
+
# For non-HTTP errors, try fallback
|
|
136
|
+
continue
|
|
137
|
+
|
|
138
|
+
error_msg = (
|
|
139
|
+
f"Could not download NeqSim from GitHub for Java {java_version}: {final_error} \n"
|
|
140
|
+
f"Tried patterns: {patterns_to_try}"
|
|
141
|
+
)
|
|
142
|
+
self.logger.error(error_msg)
|
|
143
|
+
raise RuntimeError(error_msg) from final_error
|
|
144
|
+
|
|
145
|
+
def resolve_dependency(self, java_version: int | None = None) -> Path:
|
|
146
|
+
"""
|
|
147
|
+
Resolve NeqSim dependency
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
java_version: Java version, auto-detected if None
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
Path to resolved JAR file
|
|
154
|
+
"""
|
|
155
|
+
neqsim_version = self.config["neqsim"]["version"]
|
|
156
|
+
if neqsim_version is None:
|
|
157
|
+
raise ValueError("NeqSim version must be specified in config.yaml")
|
|
158
|
+
|
|
159
|
+
java_version = self._resolve_java_version(java_version)
|
|
160
|
+
|
|
161
|
+
# Download dependency
|
|
162
|
+
jar_path = self._get_jar_from_github(neqsim_version, java_version)
|
|
163
|
+
|
|
164
|
+
return jar_path
|
|
165
|
+
|
|
166
|
+
def _resolve_java_version(self, java_version: int | None) -> int:
|
|
167
|
+
"""Resolve the Java version to use"""
|
|
168
|
+
if java_version is not None:
|
|
169
|
+
return java_version
|
|
170
|
+
|
|
171
|
+
try:
|
|
172
|
+
import jpype
|
|
173
|
+
|
|
174
|
+
if jpype.isJVMStarted():
|
|
175
|
+
return jpype.getJVMVersion()[0]
|
|
176
|
+
else:
|
|
177
|
+
raise RuntimeError("JVM is not started; cannot auto-detect Java version")
|
|
178
|
+
except ImportError:
|
|
179
|
+
raise RuntimeError("JPype is not available; cannot auto-detect Java version") from None
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def jar_cache_dir(self) -> Path:
|
|
183
|
+
"""Access to JAR cache directory for backward compatibility"""
|
|
184
|
+
return self.cache_manager.jar_cache_dir
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
4
|
+
import tempfile
|
|
5
|
+
import zipfile
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class JARCacheManager:
|
|
11
|
+
"""Simplified JAR cache manager that caches one JAR per version/java_version combination"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, cache_dir: Path, config: dict, logger: logging.Logger):
|
|
14
|
+
"""
|
|
15
|
+
Initialize cache manager
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
cache_dir: Base cache directory
|
|
19
|
+
config: Configuration dictionary
|
|
20
|
+
logger: Logger instance
|
|
21
|
+
"""
|
|
22
|
+
self.cache_dir = cache_dir
|
|
23
|
+
self.jar_cache_dir = cache_dir / "jars"
|
|
24
|
+
self.jar_cache_dir.mkdir(parents=True, exist_ok=True)
|
|
25
|
+
self.config = config
|
|
26
|
+
self.logger = logger
|
|
27
|
+
|
|
28
|
+
def _get_cache_filename(self, version: str, java_version: int) -> str:
|
|
29
|
+
"""Generate simple cache filename for version and Java version combination"""
|
|
30
|
+
return f"neqsim-{version}-java{java_version}.jar"
|
|
31
|
+
|
|
32
|
+
def get_cached_jar(self, version: str, java_version: int) -> Optional[Path]:
|
|
33
|
+
"""Check if JAR exists in cache for the specified version and Java version"""
|
|
34
|
+
if not self.config.get("cache", {}).get("enabled", True):
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
cache_filename = self._get_cache_filename(version, java_version)
|
|
38
|
+
cached_jar = self.jar_cache_dir / cache_filename
|
|
39
|
+
|
|
40
|
+
if not cached_jar.exists():
|
|
41
|
+
self.logger.debug(f"No cached JAR found for version {version}, Java {java_version}")
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
# Verify integrity if enabled
|
|
45
|
+
if self.config.get("cache", {}).get("verify_integrity", True):
|
|
46
|
+
if not self._verify_jar_integrity(cached_jar):
|
|
47
|
+
self.logger.warning(f"Cached JAR failed integrity check, removing: {cached_jar.name}")
|
|
48
|
+
cached_jar.unlink() # Remove corrupted cache
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
self.logger.info(f"Using cached JAR: {cached_jar.name}")
|
|
52
|
+
return cached_jar
|
|
53
|
+
|
|
54
|
+
def cache_jar(self, source_jar: Path, version: str, java_version: int) -> Path:
|
|
55
|
+
"""Cache downloaded JAR file, replacing any existing cached version"""
|
|
56
|
+
if not self.config.get("cache", {}).get("enabled", True):
|
|
57
|
+
return source_jar
|
|
58
|
+
|
|
59
|
+
cache_filename = self._get_cache_filename(version, java_version)
|
|
60
|
+
cached_jar = self.jar_cache_dir / cache_filename
|
|
61
|
+
|
|
62
|
+
tmp_path = None
|
|
63
|
+
try:
|
|
64
|
+
# Create a temp file in the same directory to ensure atomic rename
|
|
65
|
+
file_descriptor, tmp_file_name = tempfile.mkstemp(prefix=cache_filename + ".", dir=str(self.jar_cache_dir))
|
|
66
|
+
os.close(file_descriptor)
|
|
67
|
+
tmp_path = Path(tmp_file_name)
|
|
68
|
+
|
|
69
|
+
shutil.copy2(source_jar, tmp_path)
|
|
70
|
+
|
|
71
|
+
# Verify the temporary JAR file before replacing
|
|
72
|
+
if not self._verify_jar_integrity(tmp_path):
|
|
73
|
+
self.logger.error(f"Downloaded JAR failed integrity check: {tmp_path}")
|
|
74
|
+
try:
|
|
75
|
+
tmp_path.unlink()
|
|
76
|
+
except Exception as e:
|
|
77
|
+
self.logger.error(f"Failed to unlink temporary file: {e}")
|
|
78
|
+
raise RuntimeError("Downloaded JAR failed integrity check")
|
|
79
|
+
|
|
80
|
+
# Replace the cached JAR atomically
|
|
81
|
+
try:
|
|
82
|
+
tmp_path.replace(cached_jar)
|
|
83
|
+
self.logger.debug(f"Replaced cached JAR: {cache_filename}")
|
|
84
|
+
except Exception as e:
|
|
85
|
+
self.logger.error(f"Failed to replace cached JAR: {e}")
|
|
86
|
+
try:
|
|
87
|
+
tmp_path.unlink()
|
|
88
|
+
except Exception as e:
|
|
89
|
+
self.logger.error(f"Failed to unlink temporary file: {e}")
|
|
90
|
+
raise
|
|
91
|
+
|
|
92
|
+
self.logger.info(f"Cached JAR: {cached_jar.name}")
|
|
93
|
+
return cached_jar
|
|
94
|
+
finally:
|
|
95
|
+
try:
|
|
96
|
+
if tmp_path is not None and tmp_path.exists():
|
|
97
|
+
tmp_path.unlink()
|
|
98
|
+
except Exception as e:
|
|
99
|
+
self.logger.error(f"Failed to unlink temporary file during cleanup: {e}")
|
|
100
|
+
|
|
101
|
+
def _verify_jar_integrity(self, jar_path: Path) -> bool:
|
|
102
|
+
"""Verify JAR file is not corrupted"""
|
|
103
|
+
try:
|
|
104
|
+
# Basic checks: file exists, has content, ends with proper extension
|
|
105
|
+
if not jar_path.exists() or jar_path.stat().st_size == 0:
|
|
106
|
+
return False
|
|
107
|
+
|
|
108
|
+
# Check if it's a valid ZIP file (JARs are ZIP files)
|
|
109
|
+
with zipfile.ZipFile(jar_path, "r") as zf:
|
|
110
|
+
# Try to read the file list - this will fail if corrupted
|
|
111
|
+
zf.namelist()
|
|
112
|
+
return True
|
|
113
|
+
except Exception as e:
|
|
114
|
+
self.logger.debug(f"JAR integrity check failed for {jar_path}: {e}")
|
|
115
|
+
return False
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
try:
|
|
2
|
+
import jpype
|
|
3
|
+
|
|
4
|
+
JPYPE_AVAILABLE = True
|
|
5
|
+
except ImportError:
|
|
6
|
+
JPYPE_AVAILABLE = False
|
|
7
|
+
jpype = None
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from jneqsim.common.load_config import load_config
|
|
13
|
+
from jneqsim.common.setup_logging import setup_logging
|
|
14
|
+
|
|
15
|
+
from .dependency_manager import NeqSimDependencyManager
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_neqsim_jar_path(java_version: tuple[int, ...], logger: logging.Logger, config: dict) -> str:
|
|
19
|
+
"""
|
|
20
|
+
Get NeqSim JAR path using enhanced dependency resolution
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
java_version: JVM version tuple (major, minor, patch)
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
Path to NeqSim JAR file
|
|
27
|
+
|
|
28
|
+
Raises:
|
|
29
|
+
RuntimeError: If dependency resolution fails
|
|
30
|
+
"""
|
|
31
|
+
try:
|
|
32
|
+
manager = NeqSimDependencyManager(logger, config)
|
|
33
|
+
jar_path = manager.resolve_dependency(java_version=java_version[0])
|
|
34
|
+
return str(jar_path)
|
|
35
|
+
except Exception as e:
|
|
36
|
+
raise RuntimeError(
|
|
37
|
+
f"Failed to resolve NeqSim dependency for Java {'.'.join(map(str, java_version))}: {e}"
|
|
38
|
+
) from e
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# Load configuration and setup logging
|
|
42
|
+
config_path = Path(__file__).parent / "common" / "config.yaml"
|
|
43
|
+
config = load_config(config_path)
|
|
44
|
+
logger = setup_logging(config)
|
|
45
|
+
|
|
46
|
+
# Initialize JVM and NeqSim package
|
|
47
|
+
neqsim = None # Default to None, cannot use NeqSim if JVM fails to start
|
|
48
|
+
|
|
49
|
+
if JPYPE_AVAILABLE and jpype and not jpype.isJVMStarted():
|
|
50
|
+
# We need to start the JVM before importing the neqsim package
|
|
51
|
+
try:
|
|
52
|
+
jpype.startJVM()
|
|
53
|
+
jar_path = get_neqsim_jar_path(jpype.getJVMVersion(), logger, config)
|
|
54
|
+
jpype.addClassPath(jar_path)
|
|
55
|
+
|
|
56
|
+
import jpype.imports
|
|
57
|
+
|
|
58
|
+
# This is the java package, added to the python scope by "jpype.imports"
|
|
59
|
+
neqsim = jpype.JPackage("neqsim")
|
|
60
|
+
except Exception as e:
|
|
61
|
+
# JVM Start failed, handle gracefully
|
|
62
|
+
|
|
63
|
+
logger.error(f"Failed to initialize JVM: {e}. NeqSim functionality will not be available.", stacklevel=2)
|
|
64
|
+
elif JPYPE_AVAILABLE and jpype and jpype.isJVMStarted():
|
|
65
|
+
# JVM already started, just get the package
|
|
66
|
+
import jpype.imports
|
|
67
|
+
|
|
68
|
+
neqsim = jpype.JPackage("neqsim")
|