Skip to content

Commit

Permalink
Merge pull request #6 from ProjetaAi/new_datasets
Browse files Browse the repository at this point in the history
New datasets
  • Loading branch information
ms-cmy authored Sep 6, 2023
2 parents 51f182e + a7d92b4 commit 26f0170
Show file tree
Hide file tree
Showing 20 changed files with 1,645 additions and 148 deletions.
87 changes: 45 additions & 42 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,65 +33,65 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'autoapi.extension',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'revitron_sphinx_theme',
'sphinx_autodoc_typehints',
'sphinx_copybutton',
"sphinx.ext.autodoc",
"autoapi.extension",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
"sphinx.ext.napoleon",
"revitron_sphinx_theme",
"sphinx_autodoc_typehints",
"sphinx_copybutton",
]

html_static_path = ["_static"]
html_css_files = ["style.css"]

autoapi_dirs = ['../kedro_projetaai']
autoapi_dirs = ["../kedro_projetaai"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'Kedro ProjetaAi'
copyright = '2022, Ipiranga'
author = 'Nickolas da Rocha Machado, Gabriel Daiha Alves'
project = "Kedro ProjetaAi"
copyright = "2022, Ipiranga"
author = "Nickolas da Rocha Machado, Gabriel Daiha Alves"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0.1'
version = "0.0.1"
# The full version, including alpha/beta/rc tags.
release = '0.0.1'
release = "0.0.1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
Expand All @@ -107,47 +107,42 @@
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'color_scheme': 'dark'
}
html_theme_options = {"color_scheme": "dark"}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
"**": [
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
]
}

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'KedroProjetaAidoc'
htmlhelp_basename = "KedroProjetaAidoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -158,18 +153,21 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc, 'KedroProjetaAi.tex', 'Kedro ProjetaAi Documentation',
'Ipiranga', 'manual'
master_doc,
"KedroProjetaAi.tex",
"Kedro ProjetaAi Documentation",
"Ipiranga",
"manual",
),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(
master_doc, 'kedroprojetaai', 'Kedro ProjetaAi Documentation', [author], 1
)]
man_pages = [
(master_doc, "kedroprojetaai", "Kedro ProjetaAi Documentation", [author], 1)
]

# -- Options for Texinfo output -------------------------------------------

Expand All @@ -178,10 +176,15 @@
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc, 'KedroProjetaAi', 'Kedro ProjetaAi Documentation', author,
'KedroProjetaAi', 'One line description of project.', 'Miscellaneous'
master_doc,
"KedroProjetaAi",
"Kedro ProjetaAi Documentation",
author,
"KedroProjetaAi",
"One line description of project.",
"Miscellaneous",
),
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}
1 change: 0 additions & 1 deletion kedro_projetaai/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,4 @@ def setup_cli() -> click.Group:
plugins = _import_plugins()
_install_plugins(projetaai, plugins)
projetaai.add_command(ci)

return projetaai
1 change: 1 addition & 0 deletions kedro_projetaai/cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ENTRY_POINTS = {
"CLI": "projetaai.cli",
"CI": "projetaai.ci",
"PROJECT": "projetaai.projetaai_lab",
}

PYTHON_VERSION = (
Expand Down
3 changes: 1 addition & 2 deletions kedro_projetaai/overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def override_get_credentials():
"""
_kedro_get_credentials = data_catalog._get_credentials

def _get_credentials(credential_name: str,
credentials: Dict[str, T]) -> T:
def _get_credentials(credential_name: str, credentials: Dict[str, T]) -> T:
"""Get the credential from the credentials dictionary.
Args:
Expand Down
37 changes: 17 additions & 20 deletions kedro_projetaai/packing/suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@

def _validate_name(name: str) -> bool:
# Validates a name
assert re.match(r'[A-Za-z_]+', name).group(0) == name and len(name) > 3,\
('The name must be at least 3 characters long and only contain letters'
'and underscores only.')
assert re.match(r"[A-Za-z_]+", name).group(0) == name and len(name) > 3, (
"The name must be at least 3 characters long and only contain letters"
"and underscores only."
)


def _parse_branch_name(branch: str) -> str:
# Parses the branch name
if branch.startswith('experiment/'):
branch = branch.split('experiment/')[1]
if branch.startswith("experiment/"):
branch = branch.split("experiment/")[1]
return branch
else:
return ''
return ""


def get_branch_name() -> str:
Expand All @@ -28,7 +29,7 @@ def get_branch_name() -> str:
try:
r = Repo()
except InvalidGitRepositoryError:
return ''
return ""
return r.active_branch.name


Expand All @@ -39,9 +40,7 @@ def _get_experiment_from_git() -> str:


def get_experiment_name(
project: str,
experiment: str = None,
branch: str = None
project: str, experiment: str = None, branch: str = None
) -> str:
"""Gets a suggested experiment name from the current git branch.
Expand All @@ -68,7 +67,7 @@ def get_experiment_name(
experiment = _parse_branch_name(branch)

if experiment:
experiment = f'{project}_{experiment}'
experiment = f"{project}_{experiment}"
else:
experiment = project

Expand All @@ -78,20 +77,18 @@ def get_experiment_name(

def _parse_pipeline_name(pipeline: str) -> tuple:
# Parses the pipeline name
if pipeline == '__default__':
pipeline = 'default'
if pipeline == "__default__":
pipeline = "default"
return pipeline


def _extract_raw_experiment(project: str, experiment: str) -> str:
# Extracts the raw experiment name from the pipeline name
return re.sub(f'^{project}_?', '', experiment)
return re.sub(f"^{project}_?", "", experiment)


def get_pipeline_name(
project: str,
pipeline: str = '__default__',
experiment: str = None
project: str, pipeline: str = "__default__", experiment: str = None
) -> str:
"""Gets a suggested pipeline.
Expand All @@ -109,12 +106,12 @@ def get_pipeline_name(
str: '<project>_<pipeline>_<experiment>' or '<project>_<pipeline>'.
"""
pipeline = _parse_pipeline_name(pipeline)
pipeline = f'_{pipeline}'
pipeline = f"_{pipeline}"

experiment = _extract_raw_experiment(project, experiment)
if experiment:
experiment = f'_{experiment}'
experiment = f"_{experiment}"

pipeline = f'{project}{pipeline}{experiment}'
pipeline = f"{project}{pipeline}{experiment}"
_validate_name(pipeline)
return pipeline
16 changes: 8 additions & 8 deletions kedro_projetaai/starters.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
"""Starter templates definition."""
from kedro.framework.cli.starters import KedroStarterSpec

STARTERS_REPO = 'git+https://github.com/ProjetaAi/projetaai-starters.git'
STARTERS_REPO = "git+https://github.com/ProjetaAi/projetaai-starters.git"

project_starters = [
KedroStarterSpec(
alias='projetaai',
alias="projetaai",
template_path=STARTERS_REPO,
directory='for_projetaai/project/projetaai',
directory="for_projetaai/project/projetaai",
),
KedroStarterSpec(
alias='projetaai_mp',
alias="projetaai_mp",
template_path=STARTERS_REPO,
directory='for_projetaai/project/projetaai_mp',
directory="for_projetaai/project/projetaai_mp",
),
KedroStarterSpec(
alias='projetaai_adbc',
alias="projetaai_adbc",
template_path=STARTERS_REPO,
directory='for_projetaai/project/projetaai_adbc',
)
directory="for_projetaai/project/projetaai_adbc",
),
]
Empty file.
Loading

0 comments on commit 26f0170

Please sign in to comment.