Skip to content

Commit

Permalink
Merge pull request #192 from equinor/test2.4.15
Browse files Browse the repository at this point in the history
Remove Java 8 library and update with new NeqSim lib
  • Loading branch information
EvenSol authored Apr 17, 2023
2 parents c253e0e + 3a57df3 commit bb5b567
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 25 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,4 @@ jobs:
python -m pip install --upgrade pip
python -m pip install neqsim pytest
- name: Run tests with pytest
run: python -m pytest
buildforJava8:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v3
- name: Install Python 3
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install neqsim pytest
- name: Run tests with pytest
run: python -m pytest
run: python -m pytest
Binary file removed neqsim/lib/libj8/neqsim-2.4.4-Java8.jar
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions neqsim/neqsimpython.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import jpype

if not jpype.isJVMStarted():
jvmVersion = jpype.getJVMVersion()[0]
if jvmVersion <= 8:
jpype.addClassPath('./lib/libj8/*')
else:
jpype.addClassPath('./lib/*')
jpype.addClassPath('./lib/*')
jpype.startJVM(convertStrings=False)
jvmVersion = jpype.getJVMVersion()[0]
if jvmVersion<=8:
print('Your version of Java is not supported. Please upgrade to Java version 11 or higher.')
print('See: https://github.com/equinor/neqsimpython#prerequisites')

jNeqSim = jpype.JPackage('neqsim')
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="neqsim",
version="2.4.14",
version="2.4.15",
author="Even Solbraa",
author_email="[email protected]",
description="NeqSim is a tool for thermodynamic and process calculations",
Expand Down
7 changes: 7 additions & 0 deletions tests/test_NeqSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def test_Viscosity():
gasViscosity = thermoSystem.getPhase(0).getViscosity("kg/msec")
assert abs(1.0760998263782569e-05 - gasViscosity) < 1e-10

def test_updateDatabase():
jNeqSim.util.database.NeqSimDataBase.updateTable("COMP",
"classpath:/data/COMP.csv")

def test_hasComponentDatabase():
assert jNeqSim.util.database.NeqSimDataBase.hasComponent("methane") == True

def test_fullOffshoreProcess():
import pandas as pd
import math
Expand Down

0 comments on commit bb5b567

Please sign in to comment.