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

add upload_results as a config option #191

Merged
merged 14 commits into from
Sep 27, 2023
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
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two things: I don't thin env.config_data can ever be none, so I don't think you need that check
I think you could do 3 or less. I have run some multiple packings recently that I would like to see the results of.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all config settings should also have a default setting in the config loader

}
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
}
Loading