Skip to content

Commit

Permalink
updated exec and models
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Jan 21, 2024
1 parent 4249db0 commit 9e9559c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
20 changes: 12 additions & 8 deletions biosimulators_simularium/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ def execute(
# generate vtp
vtp_filename = setup_config.get('vtp_filename', 'simulation.vtp')
vtp_filepath: str = os.path.join(working_dir, vtp_filename)
generate_vtp_file(mesh, vtp_filepath)
generate_vtp_file(mesh, filename=vtp_filepath)

# generate a simularium file
return generate_simularium_file(
trajectory,
working_dir,
output_dir,
agent_params,
Expand All @@ -55,9 +56,16 @@ def execute(
)


def generate_vtp_file(mesh: pv.PolyData, save_path):
# write the vtp file
return mesh.save(save_path)
def generate_vtp_file(mesh: pv.PolyData, **kwargs):
"""write a vtp file to `save_path` based on the `mesh`. Kwargs according to `pv.PolyData().save()` args.
Keyword Args:
filename:`str`: path in which to save the vtp file.
binary: bool = True,
texture: Any = None,
recompute_normals: Any
"""
return mesh.save(kwargs['filename'])


def generate_simularium_file(
Expand Down Expand Up @@ -128,10 +136,6 @@ def generate_simularium_file(
return write_simularium_file(trajectory, simularium_filename=simularium_filepath, json=use_json)


def generate_vtp_file(data=None):
pass


def execute_generate(write_simularium, write_vtp, **kwargs):
# TODO: implement callbacks
pass
Expand Down
2 changes: 1 addition & 1 deletion biosimulators_simularium/tests/fixtures/MinE/model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define L_PARAM2 1.5 # half of cell length minus radius
define NUMBER_MIND 4000 # number of MinD in cell
define NUMBER_MINE 1400 # number of MinE in cell

define TIME_STOP 10 # stopping time
define TIME_STOP 3 # stopping time

#define KICK_START 1 # start with MinD_ATP at an end

Expand Down
2 changes: 1 addition & 1 deletion biosimulators_simularium/tests/fixtures/crowding/model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ boundaries z 0 20

frame_thickness 0

define TIME_STOP 10
define TIME_STOP 3

time_start 0
time_stop TIME_STOP
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion biosimulators_simularium/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

mol_output = generate_output(dir_fp=MIN_E_DIR)
mesh = generate_interpolated_mesh(mol_output=mol_output)
print(mesh.point_normals)
print(dir(mesh))

0 comments on commit 9e9559c

Please sign in to comment.