Skip to content

Commit bd8ec42

Browse files
committed
rename param json_recipe
1 parent 1f2d2e3 commit bd8ec42

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

cellpack/autopack/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,14 @@ def read_text_file(filename, destination="", cache="collisionTrees", force=None)
411411

412412

413413
def load_file(
414-
filename, destination="", cache="geometries", force=None, use_docker=False, recipe_obj=None
414+
filename, destination="", cache="geometries", force=None, use_docker=False, json_recipe=None
415415
):
416-
if recipe_obj is not None:
416+
if json_recipe is not None:
417417
composition = DBRecipeLoader.remove_empty(
418-
recipe_obj.get("composition", {})
418+
json_recipe.get("composition", {})
419419
)
420-
recipe_obj["composition"] = composition
421-
return recipe_obj, None, False
420+
json_recipe["composition"] = composition
421+
return json_recipe, None, False
422422
if is_remote_path(filename):
423423
database_name, file_path = convert_db_shortname_to_url(filename)
424424
if database_name == DATABASE_IDS.GITHUB:

cellpack/autopack/loaders/recipe_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ class RecipeLoader(object):
3030
# TODO: add all default values here
3131
default_values = default_recipe_values.copy()
3232

33-
def __init__(self, input_file_path, save_converted_recipe=False, use_docker=False, recipe_obj=None):
33+
def __init__(self, input_file_path, save_converted_recipe=False, use_docker=False, json_recipe=None):
3434
_, file_extension = os.path.splitext(input_file_path)
3535
self.current_version = CURRENT_VERSION
3636
self.file_path = input_file_path
3737
self.file_extension = file_extension
3838
self.ingredient_list = []
3939
self.compartment_list = []
4040
self.save_converted_recipe = save_converted_recipe
41-
self.recipe_obj = recipe_obj
41+
self.json_recipe = json_recipe
4242

4343
# set CURRENT_RECIPE_PATH appropriately for remote(firebase) vs local recipes
4444
if autopack.is_remote_path(self.file_path):
@@ -170,7 +170,7 @@ def _migrate_version(self, old_recipe):
170170

171171
def _read(self, resolve_inheritance=True, use_docker=False):
172172
new_values, database_name, is_unnested_firebase = autopack.load_file(
173-
self.file_path, cache="recipes", use_docker=use_docker, recipe_obj=self.recipe_obj
173+
self.file_path, cache="recipes", use_docker=use_docker, json_recipe=self.json_recipe
174174
)
175175
if database_name == "firebase":
176176
if is_unnested_firebase:

cellpack/bin/data-manifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"assay-dev": {
3+
"data_source": "https://s3-us-west-2.amazonaws.com/file-download-service.allencell.org/assay-dev_2018-10-03.csv?versionId=XVdmE.6g1kk77c7jYA2Ge54eehTjY_AP",
4+
"static_files": []
5+
},
6+
"test": {
7+
"data_source": "https://cellpack-demo.s3.us-west-2.amazonaws.com/alli-test/test-manifest.csv",
8+
"static_files": []
9+
}
10+
}

cellpack/bin/pack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
def pack(
28-
recipe, config_path=None, analysis_config_path=None, docker=False, validate=True, recipe_str=None
28+
recipe, config_path=None, analysis_config_path=None, docker=False, validate=True, json_recipe=None
2929
):
3030
"""
3131
Initializes an autopack packing from the command line
@@ -40,7 +40,7 @@ def pack(
4040
packing_config_data = ConfigLoader(config_path, docker).config
4141

4242
recipe_loader = RecipeLoader(
43-
recipe, packing_config_data["save_converted_recipe"], docker, recipe_str
43+
recipe, packing_config_data["save_converted_recipe"], docker, json_recipe
4444
)
4545
recipe_data = recipe_loader.recipe_data
4646
analysis_config_data = {}

docker/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async def run_packing(self, recipe, config, job_id, body=None):
1616
os.environ["AWS_BATCH_JOB_ID"] = job_id
1717
self.update_job_status(job_id, "RUNNING")
1818
try:
19-
pack(recipe=recipe, config_path=config, docker=True, recipe_str=body)
19+
pack(recipe=recipe, config_path=config, docker=True, json_recipe=body)
2020
except Exception as e:
2121
self.update_job_status(job_id, "FAILED", error_message=str(e))
2222

0 commit comments

Comments
 (0)