Skip to content

Commit

Permalink
add upload_results as a config option (#191)
Browse files Browse the repository at this point in the history
* upload local recipes to S3

* update README and add boto3 into requirements

* lint

* rerange import order

* add save_file for S3 uploads and url generation

* delete redundant error msg

* add "upload_results" in config files as an option

* conditionally call post_and_open_file

* add check `number_of_packings`

* update conditional statement

* update
  • Loading branch information
rugeli authored Sep 27, 2023
1 parent 58c0256 commit fee423f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions cellpack/autopack/loaders/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ConfigLoader(object):
"show_sphere_trees": False,
"show_progress_bar": False,
"spacing": None,
"upload_results": False,
"use_periodicity": False,
"version": 1.0,
}
Expand Down
5 changes: 4 additions & 1 deletion cellpack/autopack/writers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ def save_as_simularium(self, env, all_ingr_as_array, compartments):
file_name = env.helper.writeToFile(
env.result_file, env.boundingBox, env.name, env.version
)
autopack.helper.post_and_open_file(file_name)
if env.config_data.get(
"upload_results", env.config_data.get("number_of_packings", 1) <= 1
):
autopack.helper.post_and_open_file(file_name)

def save_Mixed_asJson(
self,
Expand Down
3 changes: 2 additions & 1 deletion cellpack/tests/packing-configs/test_parallel_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"number_of_packings": 5,
"spacing": null,
"use_periodicity": false,
"show_sphere_trees": true
"show_sphere_trees": true,
"upload_results": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"spacing": null,
"parallel": false,
"use_periodicity": false,
"show_sphere_trees": true
"show_sphere_trees": true,
"upload_results": false
}
3 changes: 2 additions & 1 deletion examples/packing-configs/pcna_parallel_packing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"show_progress_bar": true,
"spacing": 2.5,
"use_periodicity": false,
"show_sphere_trees": false
"show_sphere_trees": false,
"upload_results": false
}
3 changes: 2 additions & 1 deletion examples/packing-configs/peroxisome_packing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"spacing": 2.5,
"use_periodicity": false,
"show_sphere_trees": false,
"load_from_grid_file": false
"load_from_grid_file": true,
"upload_results": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"show_sphere_trees": false,
"image_export_options": {
"hollow": false,
"voxel_size": [1,1,1],
"voxel_size": [1, 1, 1],
"projection_axis": "z"
}
},
"upload_results": false
}
3 changes: 2 additions & 1 deletion examples/packing-configs/run.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"use_periodicity": false,
"show_sphere_trees": false,
"load_from_grid_file": false,
"save_converted_recipe": true
"save_converted_recipe": true,
"upload_results": true
}

0 comments on commit fee423f

Please sign in to comment.