Skip to content

Commit c7f4bc9

Browse files
minor formatting changes
1 parent f23e56b commit c7f4bc9

6 files changed

Lines changed: 39 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,7 @@ jobs:
3434
python -m pip install --upgrade pip
3535
pip install -e .[dev]
3636
37-
# 6. Check code quality using Ruff
38-
- name: Lint and Format check with Ruff
39-
run: |
40-
# This checks for coding standards, unused variables, and imports
41-
ruff check .
42-
# This ensures code adheres to format rules (line lengths, spaces)
43-
ruff format --check .
44-
45-
# 7. Run your unit test suite via pytest
37+
# 6. Run your unit test suite via pytest
4638
- name: Test with pytest
4739
run: |
4840
pytest

cinnamon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.0"
1+
__version__ = "1.1.0"

cinnamon/component.py

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
from __future__ import annotations
22

3-
from typing import Optional, TypeVar, Type
3+
from typing import Optional, Type, TypeVar
44

55
import cinnamon.configuration
66
import cinnamon.registry
77

8-
C = TypeVar('C', bound='Component')
8+
C = TypeVar("C", bound="Component")
99

1010
__all__ = [
11-
'Component',
11+
"Component",
1212
]
1313

1414

1515
class Component:
1616
"""
17-
A component defines any logic of a program, including data loading, data visualization, and model training.
17+
A component defines any logic of a program, including data loading,
18+
data visualization, and model training.
1819
"""
1920

2021
@classmethod
2122
def instantiate(
22-
cls: Type[C],
23-
registration_key: Optional[cinnamon.registry.Registration] = None,
24-
name: Optional[str] = None,
25-
namespace: Optional[str] = None,
26-
tags: cinnamon.configuration.Tags = None,
27-
**build_args
23+
cls: Type[C],
24+
registration_key: Optional[cinnamon.registry.Registration] = None,
25+
name: Optional[str] = None,
26+
namespace: Optional[str] = None,
27+
tags: cinnamon.configuration.Tags = None,
28+
**build_args,
2829
) -> C:
2930
"""
30-
Syntactic sugar for instantiating a ``Component`` from a ``RegistrationKey`` in implicit format.
31+
Syntactic sugar for instantiating a ``Component`` from a
32+
``RegistrationKey`` in implicit format.
3133
3234
Args:
33-
registration_key: the ``RegistrationKey`` used to register the ``Configuration`` class.
35+
registration_key: the ``RegistrationKey`` used to register the
36+
``Configuration`` class.
3437
name: the ``name`` field of ``RegistrationKey``
3538
tags: the ``tags`` field of ``RegistrationKey``
3639
namespace: the ``namespace`` field of ``RegistrationKey``
@@ -40,18 +43,26 @@ def instantiate(
4043
A ``Component`` instance
4144
4245
Raises:
43-
``InvalidConfigurationTypeException``: if there's a mismatch between the ``Configuration`` class used
44-
during registration and the type of the built ``Configuration`` instance using the registered
46+
``InvalidConfigurationTypeException``: if there's a mismatch
47+
between the ``Configuration`` class used
48+
during registration and the type of the built ``Configuration``
49+
instance using the registered
4550
``constructor`` method (see ``ConfigurationInfo`` arguments).
4651
47-
``NotBoundException``: if the ``Configuration`` is not bound to any ``Component``.
52+
``NotBoundException``: if the ``Configuration`` is not bound
53+
to any ``Component``.
4854
"""
49-
component = cinnamon.registry.Registry.instantiate_component(registration_key=registration_key,
50-
name=name,
51-
tags=tags,
52-
namespace=namespace,
53-
**build_args)
55+
component = cinnamon.registry.Registry.instantiate_component(
56+
registration_key=registration_key,
57+
name=name,
58+
tags=tags,
59+
namespace=namespace,
60+
**build_args,
61+
)
5462
if not isinstance(component, cls):
55-
raise RuntimeError(f'The instantiated component is not an instance of {cls}. Got {type(component)}')
63+
raise RuntimeError(
64+
f"The instantiated component is not an instance of {cls}."
65+
f" Got {component.__class__.__name__}"
66+
)
5667

57-
return component
68+
return component

cinnamon/utility/inquirer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def select_tags(keys: List[cinnamon.registry.RegistrationKey]):
103103

104104
current_tag = inquirer.select(
105105
message=f"Select a tag (total = {len(tags)}) "
106-
f"\nCurrent selection: {selected_tags}",
106+
f"\nCurrent selection: {selected_tags}",
107107
choices=choices,
108108
default=None,
109109
mandatory=True,
@@ -135,7 +135,7 @@ def select_keys(
135135

136136
selected_indexes = inquirer.checkbox(
137137
message=f"Select one or more keys to execute (total = {len(keys)})"
138-
f" \nSelected tags: {selected_tags}",
138+
f" \nSelected tags: {selected_tags}",
139139
choices=[
140140
Choice(
141141
name=f"{idx + 1}. {key.from_tags_simplification(tags=selected_tags).to_pretty_string()}", # noqa: E501

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ version = { attr = "cinnamon.__version__" }
4747
# Target Python 3.8+ compatibility
4848
target-version = "py38"
4949
line-length = 88
50-
select = ["E", "F", "I", "W"] # Basic styles, Pyflakes, and Import sorting
50+
lint.select = ["E", "F", "I", "W"] # Basic styles, Pyflakes, and Import sorting

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from setuptools import setup
22

3-
setup()
3+
setup()

0 commit comments

Comments
 (0)