Skip to content

Commit 66c6fd2

Browse files
rugelimogres
andauthored
clean up and update V2 recipes and configs in example and tests folders (#403)
* fix plotly show error * add save_plot_figures to config loader * remove default for save_plot_figures * archive recipes * more archived recipe * update v2 recipes and configs * add template recipes to example * Update default config options * Set "browser" as the default renderer for plotly * Update and format example recipes to remove singleton lists * Update examples in README.md * remove archived folder --------- Co-authored-by: mogres <saurabh.mogre@alleninstitute.org>
1 parent 567eecc commit 66c6fd2

42 files changed

Lines changed: 718 additions & 1170 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ pip install -e .
3030
```
3131

3232
## Pack example recipes
33-
1. v1: `pack -r examples/recipes/v1/NM_Analysis_FigureB1.0.json -c examples/packing-configs/run.json`
34-
2. v2: `pack -r examples/recipes/v2/one_sphere.json -c examples/packing-configs/run.json`
35-
3. Pack from remote server: `pack -r github:recipes/NM_Analysis_FigureB1.0.json -c examples/packing-configs/run.json`
33+
1. v1: `pack -r examples/recipes/v1/NM_Analysis_FigureB1.0.json`
34+
2. v2: `pack -r examples/recipes/v2/spheres_in_a_box.json`
35+
3. Pack from remote server: `pack -r github:recipes/NM_Analysis_FigureB1.0.json `
3636

3737
**Stable Release:** `pip install cellpack`<br>
3838
**Development Head:** `pip install git+https://github.com/mesoscope/cellpack.git`

cellpack/autopack/Analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ def doloop(
11791179
across seeds
11801180
"""
11811181
number_of_packings = packing_config_data["number_of_packings"]
1182-
plot_figures = packing_config_data.get("save_plot_figures", True)
1182+
plot_figures = packing_config_data["save_plot_figures"]
11831183
show_grid = packing_config_data["show_grid_plot"]
11841184
image_export_options = packing_config_data.get("image_export_options")
11851185

cellpack/autopack/loaders/config_loader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
2-
import os
3-
42
import json
3+
import os
54
from json import encoder
65

76
import cellpack.autopack as autopack
@@ -28,7 +27,7 @@ class ConfigLoader(object):
2827
default_values = {
2928
"clean_grid_cache": False,
3029
"format": "simularium",
31-
"load_from_grid_file": False,
30+
"load_from_grid_file": True,
3231
"inner_grid_method": "trimesh",
3332
"live_packing": False,
3433
"number_of_packings": 1,
@@ -43,9 +42,10 @@ class ConfigLoader(object):
4342
"save_analyze_result": False,
4443
"save_converted_recipe": False,
4544
"save_gradient_data_as_image": False,
45+
"save_plot_figures": True,
4646
"show_grid_plot": False,
4747
"show_sphere_trees": False,
48-
"show_progress_bar": False,
48+
"show_progress_bar": True,
4949
"spacing": None,
5050
"upload_results": True,
5151
"use_periodicity": False,

cellpack/autopack/plotly_result.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
from cellpack.autopack.upy.colors import create_divergent_color_map_with_scaled_values
2-
import plotly.graph_objects as go
3-
import plotly.colors as pcolors
41
import numpy
2+
import plotly.colors as pcolors
3+
import plotly.graph_objects as go
4+
import plotly.io as pio
5+
6+
from cellpack.autopack.upy.colors import create_divergent_color_map_with_scaled_values
7+
8+
pio.renderers.default = "browser"
59

610

711
class PlotlyAnalysis:
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
{
22
"name": "test_config",
3-
"format": "simularium",
4-
"inner_grid_method": "trimesh",
5-
"live_packing": false,
6-
"ordered_packing": false,
73
"out": "cellpack/tests/outputs/",
84
"overwrite_place_method": true,
95
"place_method": "spheresSST",
106
"save_analyze_result": true,
11-
"show_grid_plot": false,
12-
"spacing": null,
13-
"parallel": false,
14-
"use_periodicity": false,
15-
"show_sphere_trees": true,
16-
"upload_results": false
7+
"show_sphere_trees": true
178
}

cellpack/tests/packing-configs/test_gradient_data_image.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"save_analyze_result": true,
44
"show_grid_plot": true,
55
"spacing": 0.25,
6-
"show_sphere_trees": false,
76
"load_from_grid_file": true,
87
"save_gradient_data_as_image": true,
98
"image_export_options": {

cellpack/tests/packing-configs/test_grid_plot_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "show_grid_plot",
33
"out": "cellpack/tests/outputs/",
4-
"load_from_grid_file": false,
54
"overwrite_place_method": true,
65
"place_method": "spheresSST",
76
"save_analyze_result": true,

cellpack/tests/packing-configs/test_image_config_base.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
{
22
"name": "test_image_config_base",
3-
"format": "simularium",
4-
"inner_grid_method": "trimesh",
5-
"live_packing": false,
6-
"ordered_packing": false,
7-
"out": "out/",
83
"overwrite_place_method": true,
94
"place_method": "spheresSST",
105
"save_analyze_result": true,
116
"show_grid_plot": true,
12-
"number_of_packings": 1,
137
"spacing": 2.5,
14-
"use_periodicity": false,
15-
"show_sphere_trees": false,
168
"load_from_grid_file": true,
179
"save_converted_recipe": true,
1810
"image_export_options": {

cellpack/tests/packing-configs/test_image_config_convolved.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
{
22
"name": "test_image_config_convolved",
3-
"format": "simularium",
4-
"inner_grid_method": "trimesh",
5-
"live_packing": false,
6-
"ordered_packing": false,
73
"out": "out/images/",
84
"overwrite_place_method": true,
95
"place_method": "spheresSST",
106
"save_analyze_result": true,
11-
"show_grid_plot": false,
12-
"number_of_packings": 1,
137
"spacing": 2.5,
14-
"use_periodicity": false,
15-
"show_sphere_trees": false,
168
"load_from_grid_file": true,
179
"save_converted_recipe": true,
1810
"image_export_options": {

cellpack/tests/packing-configs/test_image_config_solid_seg.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
{
22
"name": "test_image_config_solid_seg",
3-
"format": "simularium",
4-
"inner_grid_method": "trimesh",
5-
"live_packing": false,
6-
"ordered_packing": false,
7-
"out": "out/",
83
"overwrite_place_method": true,
94
"place_method": "spheresSST",
105
"save_analyze_result": true,
11-
"show_grid_plot": false,
12-
"number_of_packings": 1,
13-
"spacing": null,
14-
"use_periodicity": false,
15-
"show_sphere_trees": false,
166
"load_from_grid_file": true,
17-
"save_converted_recipe": false,
187
"save_plot_figures": false,
19-
"parallel": false,
208
"image_export_options": {
219
"hollow": false,
2210
"voxel_size": [1,1,1],

0 commit comments

Comments
 (0)