Skip to content

Commit

Permalink
Add Kedro files
Browse files Browse the repository at this point in the history
  • Loading branch information
astrojuanlu committed Aug 27, 2024
1 parent 77ce4ea commit b08a254
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 1 deletion.
9 changes: 9 additions & 0 deletions template/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,12 @@ dmypy.json
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks

# Kedro files
conf/local/**
!conf/local/.gitkeep
.telemetry

conf/**/*credentials*

.viz/
4 changes: 4 additions & 0 deletions template/conf/base/catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Here you can define all your data sets by using simple YAML syntax.
#
# Documentation for this file format can be found in "The Data Catalog"
# Link: https://docs.kedro.org/en/stable/data/data_catalog.html
Empty file added template/conf/local/.gitkeep
Empty file.
7 changes: 6 additions & 1 deletion template/pyproject.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ requires-python = ">=3.8"
license = {file = "LICENSE"}
description = "{{ short_description }}"
dependencies = [
# "structlog",
"kedro>=0.19.8",
]
authors = [
{name = "{{ author_name }}", email = "{{ author_email }}"}
Expand Down Expand Up @@ -48,6 +48,11 @@ doc = [
"sphinx-copybutton",
]

[tool.kedro]
project_name = "{{ project_name }}"
package_name = "{{ package_name }}"
kedro_init_version = "0.19.8"

[tool.pdm.version]
source = "scm"

Expand Down
16 changes: 16 additions & 0 deletions template/src/{{package_name}}/pipeline_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Project pipelines."""

from kedro.framework.project import find_pipelines
from kedro.pipeline import Pipeline


def register_pipelines() -> dict[str, Pipeline]:
"""Register the project's pipelines.
Returns:
A mapping from pipeline names to ``Pipeline`` objects.
"""
pipelines = find_pipelines()
# https://github.com/kedro-org/kedro/issues/2526
pipelines["__default__"] = sum(pipelines.values(), start=Pipeline([]))
return pipelines
15 changes: 15 additions & 0 deletions template/src/{{package_name}}/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Project settings.
There is no need to edit this file
unless you want to change values from the Kedro defaults.
For further information, including these default values, see
https://docs.kedro.org/en/stable/kedro_project_setup/settings.html.
"""

from kedro.config import OmegaConfigLoader

CONFIG_LOADER_CLASS = OmegaConfigLoader
CONFIG_LOADER_ARGS = {
"base_env": "base",
"default_run_env": "local",
}

0 comments on commit b08a254

Please sign in to comment.