Skip to content

Commit 8764e48

Browse files
Test out pytask interactively in a Jupyter notebook. This is a demonstration of how to use pytask to manage data processing tasks in a Pythonic way, leveraging the power of decorators and type hints to define tasks and their dependencies
1 parent 88da77e commit 8764e48

File tree

13 files changed

+810
-3
lines changed

13 files changed

+810
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ logs/*
44
.DS_Store
55
sandbox
66
slurm*
7-
data
7+
data
8+
bld

dag.pdf

7.32 KB
Binary file not shown.

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,5 @@ dependencies:
435435
- types-setuptools==76.0.0.20250313
436436
- uritemplate==4.1.1
437437
- watchdog==6.0.0
438+
- -e .
438439
prefix: /n/home03/ttapera/.conda/envs/era5_sandbox

notes/10_pytask_demo.ipynb

Lines changed: 693 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[build-system]
22
requires = ["setuptools>=64.0"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.pytask.ini_options]
6+
paths = ["src/era5_sandbox"]
7+
editor_url_scheme = "vscode"

settings.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ status = 3
3838
user = TinasheMTapera
3939

4040
### Optional ###
41-
requirements = fastcore pyprojroot ipykernel nbdev cdsapi hydra-core omegaconf ipykernel snakemake geopandas xarray shapely matplotlib cartopy rasterstats rioxarray pydrive2 google-auth numpy tqdm
41+
requirements = fastcore pyprojroot ipykernel nbdev cdsapi hydra-core omegaconf ipykernel snakemake geopandas xarray shapely matplotlib cartopy rasterstats rioxarray pydrive2 google-auth numpy tqdm pytask pygraphviz
4242
# dev_requirements =
4343
# console_scripts = src
4444
# conda_user =
0 Bytes
Binary file not shown.
634 Bytes
Binary file not shown.
Binary file not shown.

src/era5_sandbox/_modidx.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'era5_sandbox/aggregate.py'),
2424
'era5_sandbox.aggregate.resample_netcdf': ( 'aggregate.html#resample_netcdf',
2525
'era5_sandbox/aggregate.py')},
26+
'era5_sandbox.config': {},
2627
'era5_sandbox.core': { 'era5_sandbox.core.ClimateDataFileHandler': ('core.html#climatedatafilehandler', 'era5_sandbox/core.py'),
2728
'era5_sandbox.core.ClimateDataFileHandler.__enter__': ( 'core.html#climatedatafilehandler.__enter__',
2829
'era5_sandbox/core.py'),
@@ -64,4 +65,12 @@
6465
'era5_sandbox.download.main': ('download_raw_data.html#main', 'era5_sandbox/download.py')},
6566
'era5_sandbox.publish': { 'era5_sandbox.publish.gather_exposure_geodataframes': ( 'publish.html#gather_exposure_geodataframes',
6667
'era5_sandbox/publish.py'),
67-
'era5_sandbox.publish.main': ('publish.html#main', 'era5_sandbox/publish.py')}}}
68+
'era5_sandbox.publish.main': ('publish.html#main', 'era5_sandbox/publish.py')},
69+
'era5_sandbox.task_data_preparation': { 'era5_sandbox.task_data_preparation.task_add_another_column': ( 'pytask_demo.html#task_add_another_column',
70+
'era5_sandbox/task_data_preparation.py'),
71+
'era5_sandbox.task_data_preparation.task_add_one': ( 'pytask_demo.html#task_add_one',
72+
'era5_sandbox/task_data_preparation.py'),
73+
'era5_sandbox.task_data_preparation.task_create_random_data': ( 'pytask_demo.html#task_create_random_data',
74+
'era5_sandbox/task_data_preparation.py'),
75+
'era5_sandbox.task_data_preparation.task_plot_data': ( 'pytask_demo.html#task_plot_data',
76+
'era5_sandbox/task_data_preparation.py')}}}

0 commit comments

Comments
 (0)