Skip to content

Commit

Permalink
Merge branch 'master' into Container-deploy-fixes
Browse files Browse the repository at this point in the history
# Conflicts:
#	vcell-core/src/main/java/cbit/vcell/export/server/JhdfUtils.java
  • Loading branch information
CodeByDrescher committed Nov 14, 2024
2 parents 28764ae + b554cf0 commit 8b72510
Show file tree
Hide file tree
Showing 26 changed files with 270 additions and 332 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/NightlyBMDB_CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
workflow_dispatch:

env:
python-version: "3.9"
python-version: "3.10"
poetry-version: "1.2.1"

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout Our Code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [published, edited]

env:
python-version: "3.9"
python-version: "3.10"

jobs:
CI-Build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create_bs_singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
default: 3ca1093da599a0ff4229b1130efe7a3924ff2b4c

env:
python-version: "3.9"
python-version: "3.10"

jobs:
CD:
name: CD
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-model-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
workflow_dispatch:

env:
python-version: "3.9"
python-version: "3.10"
poetry-version: "1.2.1"

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout Our Code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion docker/build/Dockerfile-batch-dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/virtualcell/vcell-solvers:v0.8.1.3
FROM ghcr.io/virtualcell/vcell-solvers:v0.8.2

RUN apt-get -y update && \
apt-get install -y curl && \
Expand Down
2 changes: 1 addition & 1 deletion docker/build/Dockerfile-data-dev
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN $JAVA_HOME/bin/jlink \
--output /javaruntime

# Define base image and copy in jlink created minimal Java 17 environment
FROM python:3.9.7-slim
FROM python:3.10.15-slim
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jre-build /javaruntime $JAVA_HOME
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<jfreechart.version>1.5.0</jfreechart.version>
<jgrapht.version>1.3.0</jgrapht.version>
<jhdf.version>0.8.4</jhdf.version>
<jhdf5.cisd.version>19.04.1</jhdf5.cisd.version> <!-- deprecated -->
<jhdf5-2-10.version>2.9</jhdf5-2-10.version>
<jmatio.version>1.0</jmatio.version>
<joda-time.version>2.12.2</joda-time.version>
Expand Down
93 changes: 0 additions & 93 deletions vcell-cli-utils/vcell_cli_utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from biosimulators_utils.report.io import ReportWriter
from biosimulators_utils.sedml.data_model import Report, Plot2D, Plot3D, DataSet
from biosimulators_utils.sedml.io import SedmlSimulationReader, SedmlSimulationWriter
from deprecated import deprecated
from libsedml import SedReport, SedPlot2D, SedDocument

# Move status PY code here
Expand Down Expand Up @@ -140,97 +139,6 @@ def gen_sedml_2d_3d(omex_file_path, base_out_path):
return temp_path


@deprecated("This method is no longer used")
def exec_sed_doc(omex_file_path, base_out_path):
# defining archive
config = Config(VALIDATE_OMEX_MANIFESTS=False)
archive = CombineArchiveReader().run(in_file=omex_file_path, out_dir=tmp_dir,
config=config)

# determine files to execute
sedml_contents = get_sedml_contents(archive)

report_results = ReportResults()
for i_content, content in enumerate(sedml_contents):
content_filename = os.path.join(tmp_dir, content.location)

doc = SedmlSimulationReader().run(content_filename)

for report_filename in glob.glob(os.path.join(base_out_path, content.location, '*.csv')):
report_id = os.path.splitext(os.path.basename(report_filename))[0]

# read report from CSV file produced by VCell
data_set_df = pd.read_csv(report_filename).transpose()
data_set_df.columns = data_set_df.iloc[0]
data_set_df = data_set_df.drop(data_set_df.iloc[0].name)
data_set_df = data_set_df.reset_index()
data_set_df = data_set_df.rename(
columns={'index': data_set_df.columns.name})
data_set_df = data_set_df.transpose()
data_set_df.index.name = None

report = next(
report for report in doc.outputs if report.id == report_id)

data_set_results = DataSetResults()

# print("report: ", report, file=sys.stderr)
# print("report Type: ", type(report), file=sys.stderr)
# print("Plot Type: ", Plot2D, file=sys.stderr)
if type(report) != Plot2D and type(report) != Plot3D:
# Considering the scenario where it has the datasets in sedml
for data_set in report.data_sets:
data_set_results[data_set.id] = data_set_df.loc[data_set.label, :].to_numpy(
dtype='float64')
# print("DF for report: ", data_set_results[data_set.id], file=sys.stderr)
# print("df.types: ", data_set_results[data_set.id].dtype, file=sys.stderr)
else:
data_set_df = pd.read_csv(report_filename, header=None).T
data_set_df.columns = data_set_df.iloc[0]
data_set_df.drop(0, inplace=True)
data_set_df.reset_index(inplace=True)
data_set_df.drop('index', axis=1, inplace=True)
# print("DF for plot: ", data_set_df, file=sys.stderr)
# Considering the scenario where it doesn't have datasets in sedml (pseudo sedml for plots)
for col in list(data_set_df.columns):
data_set_results[col] = data_set_df[col].values

# append to data structure of report results
report_results[report_id] = data_set_results

# save file in desired BioSimulators format(s)
# for report_format in report_formats:
# print("HDF report: ", report, file=sys.stderr)
# print("HDF dataset results: ", data_set_results, file=sys.stderr)
# print("HDF base_out_path: ", base_out_path,file=sys.stderr)
# print("HDF path: ", os.path.join(content.location, report.id), file=sys.stderr)

rel_path = os.path.join(content.location, report.id)

if len(rel_path.split("./")) > 1:
rel_path = rel_path.split("./")[1]

if type(report) != Plot2D and type(report) != Plot3D:
ReportWriter().run(report,
data_set_results,
base_out_path,
rel_path,
format='h5')
else:
datasets = []
for col in list(data_set_df.columns):
datasets.append(DataSet(id=col, label=col, name=col))
report.data_sets = datasets
ReportWriter().run(report,
data_set_results,
base_out_path,
rel_path,
format='h5')

# Remove temp directory
shutil.rmtree(tmp_dir)


def transpose_vcml_csv(csv_file_path: str):
df = pd.read_csv(csv_file_path, header=None)
cols = list(df.columns)
Expand Down Expand Up @@ -451,7 +359,6 @@ def gen_plots_for_sed2d_only(sedml_path, result_out_dir):
fire.Fire({
'genSedml2d3d': gen_sedml_2d_3d,
'genPlotsPseudoSedml': gen_plots_for_sed2d_only,
'execSedDoc': exec_sed_doc,
'transposeVcmlCsv': transpose_vcml_csv,
'genPlotPdfs': gen_plot_pdfs,
})
3 changes: 1 addition & 2 deletions vcell-cli-utils/vcell_cli_utils/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import sys
import glob
import os
from deprecated import deprecated
from pathlib import Path
if __name__ == "__main__":
from vcell_cli_utils import cli, status
Expand Down Expand Up @@ -35,7 +34,7 @@ def genSedml2d3d(omexFilePath : str, baseOutPath : str) -> None:
def genPlotsPseudoSedml(sedmlPath : str, resultOutDir : str) -> None:
cli.gen_plots_for_sed2d_only(sedmlPath, resultOutDir)

@deprecated("This method is no longer used")
# this function is no longer used
def execSedDoc(omexFilePath : str, baseOutPath : str) -> None:
cli.exec_sed_doc(omexFilePath, baseOutPath)

Expand Down
14 changes: 0 additions & 14 deletions vcell-cli/src/main/java/org/vcell/cli/run/PythonCalls.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ public static void setExceptionMessage(String sedmlAbsolutePath, String entityId
cliPythonManager.parsePythonReturn(results, "", "Failed updating task status YAML\n");
}

public void convertCSVtoHDF(String omexFilePath, String outputDir, CLIPythonManager cliPythonManager) throws PythonStreamException {

// Convert CSV to HDF5
/*
Usage: cli.py SEDML_FILE_PATH WORKING_DIR BASE_OUT_PATH CSV_DIR <flags>
optional flags: --rel_out_path | --apply_xml_model_changes |
--report_formats | --plot_formats | --log | --indent
* */
// handle exceptions here
logger.trace("Dialing Python function execSedDoc");
String results = cliPythonManager.callPython("execSedDoc", omexFilePath, outputDir);
cliPythonManager.parsePythonReturn(results, "HDF conversion successful\n","HDF conversion failed\n");
}

// Sample STATUS YML
/*
sedDocuments:
Expand Down
18 changes: 17 additions & 1 deletion vcell-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,27 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<dependency> <!-- deprecated -->
<groupId>org.scala-saddle</groupId>
<artifactId>jhdf5_2.10</artifactId>
<version>${jhdf5-2-10.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/cisd/jhdf5 -->
<dependency>
<groupId>cisd</groupId>
<artifactId>jhdf5</artifactId>
<version>${jhdf5.cisd.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
Loading

0 comments on commit 8b72510

Please sign in to comment.