Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test pre commit #233

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ ENV/

# SNYK
.dccache
neqsim/neqsimpython.py.orig
5 changes: 3 additions & 2 deletions neqsim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ def has_tabulate():

def setDatabase(connectionString):
jNeqSim.util.database.NeqSimDataBase.setConnectionString(connectionString)

jNeqSim.util.database.NeqSimDataBase.setCreateTemporaryTables(True)


def save_xml(javaobject, filename):
xstream = jpype.JPackage("com.thoughtworks.xstream")
xstream = jpype.JPackage("com.thoughtworks.xstream")
streamer = xstream.XStream()
xml = streamer.toXML(javaobject)
xml = streamer.toXML(javaobject)
print(xml, file=open(filename, "w"))
return xml

Expand Down
File renamed without changes.
Binary file added neqsim/lib/java21/neqsim-2.5.15-Java21.jar
Binary file not shown.
Binary file added neqsim/lib/java8/neqsim-2.5.15-Java8.jar
Binary file not shown.
15 changes: 11 additions & 4 deletions neqsim/neqsimpython.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import jpype

if not jpype.isJVMStarted():
jpype.addClassPath("./lib/*")
# Could call jpype.getDefaultJVMPath() to get default JVM,
# but not able to get the orders to force loading a specific JVM
jpype.startJVM(convertStrings=False)
jvmVersion = jpype.getJVMVersion()[0]
if jvmVersion <= 8:
jvm_version = jpype.getJVMVersion()[0]
if jvm_version == 1 and jpype.getJVMVersion()[1] >= 8:
jpype.addClassPath("./lib/java8/*")
elif jvm_version >= 21:
jpype.addClassPath("./lib/java21/*")
elif jvm_version >= 11:
jpype.addClassPath("./lib/java11/*")
else:
print(
"Your version of Java is not supported. Please upgrade to Java version 11 or higher."
"Your version of Java is not supported. Please upgrade to Java version 8 or higher."
)
print("See: https://github.com/equinor/neqsimpython#prerequisites")

Expand Down
Loading