-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from LSSTDESC/tqz/utils_refactor
Utils renaming
- Loading branch information
Showing
32 changed files
with
200 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,106 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ec47ab0a", | ||
"metadata": {}, | ||
"source": [ | ||
"# Run a Saved Pipeline\n", | ||
"\n", | ||
"**Author:** Eric Charles\n", | ||
"\n", | ||
"**Last Run Successfully:** April 26, 2023" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ff1c1990", | ||
"metadata": {}, | ||
"source": [ | ||
" \n", | ||
"This notebook shows how to:\n", | ||
"\n", | ||
"1. Load a pipeline from a saved yaml file\n", | ||
"\n", | ||
"2. Run the loaded pipeline" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a29a1b21", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"import ceci\n", | ||
"from rail.core.utils import find_rail_file\n", | ||
"\n", | ||
"# To create a catalog, you need a model of what the distrubutions of the colors \n", | ||
"# are--that's what this flow file is:\n", | ||
"flow_file = find_rail_file('examples_data/goldenspike_data/data/pretrained_flow.pkl')\n", | ||
"os.environ['FLOWDIR'] = os.path.dirname(flow_file)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "deaaff62", | ||
"metadata": {}, | ||
"source": [ | ||
"Each pipeline file has an associated config file. Whenever ceci reads in a pipeline file called `[name].yml`, it will automatically look for a configuration file `[name]_config.yml` in the same directory.\n", | ||
"\n", | ||
"Here, we read in our `pipe_example.yml` pipeline, which is associated with `pipe_example.config.yml`:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2657aca0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\n", | ||
"p = ceci.Pipeline.read('pipe_example.yml')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "38e445de", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"p.run()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "cb8a7120", | ||
"metadata": {}, | ||
"source": [ | ||
"Yep, that's it." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} | ||
|
||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ec47ab0a", | ||
"metadata": {}, | ||
"source": [ | ||
"# Run a Saved Pipeline\n", | ||
"\n", | ||
"**Author:** Eric Charles\n", | ||
"\n", | ||
"**Last Run Successfully:** April 26, 2023" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ff1c1990", | ||
"metadata": {}, | ||
"source": [ | ||
" \n", | ||
"This notebook shows how to:\n", | ||
"\n", | ||
"1. Load a pipeline from a saved yaml file\n", | ||
"\n", | ||
"2. Run the loaded pipeline" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a29a1b21", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"import ceci\n", | ||
"from rail.utils.path_utils import find_rail_file\n", | ||
"\n", | ||
"# To create a catalog, you need a model of what the distrubutions of the colors \n", | ||
"# are--that's what this flow file is:\n", | ||
"flow_file = find_rail_file('examples_data/goldenspike_data/data/pretrained_flow.pkl')\n", | ||
"os.environ['FLOWDIR'] = os.path.dirname(flow_file)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "deaaff62", | ||
"metadata": {}, | ||
"source": [ | ||
"Each pipeline file has an associated config file. Whenever ceci reads in a pipeline file called `[name].yml`, it will automatically look for a configuration file `[name]_config.yml` in the same directory.\n", | ||
"\n", | ||
"Here, we read in our `pipe_example.yml` pipeline, which is associated with `pipe_example.config.yml`:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2657aca0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\n", | ||
"p = ceci.Pipeline.read('pipe_example.yml')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "38e445de", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"p.run()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "cb8a7120", | ||
"metadata": {}, | ||
"source": [ | ||
"Yep, that's it." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.