Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
finam
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FINAM
finam
Commits
8b6d7c69
Commit
8b6d7c69
authored
2 years ago
by
Martin Lange
Browse files
Options
Downloads
Patches
Plain Diff
fix error logging, fix docs for and ref to component's __getitem__
parent
092c03a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!148
Check missing components in composition
Pipeline
#124592
passed with stages
in 2 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/source/finam-book/usage/coupling_scripts.rst
+1
-1
1 addition, 1 deletion
docs/source/finam-book/usage/coupling_scripts.rst
src/finam/sdk/component.py
+8
-7
8 additions, 7 deletions
src/finam/sdk/component.py
with
9 additions
and
8 deletions
docs/source/finam-book/usage/coupling_scripts.rst
+
1
−
1
View file @
8b6d7c69
...
...
@@ -80,7 +80,7 @@ An input can be connected to an output using either ``>>`` (as in the examples),
generator.outputs["Value"] >> plot.inputs["Value"]
generator.outputs["Value"].chain(consumer.inputs["Value"])
As a shortcut, slots can be accessed by the component's ``[]`` operator directly (see :meth:`.
I
Component.__getitem__`):
As a shortcut, slots can be accessed by the component's ``[]`` operator directly (see :meth:`.Component.__getitem__`):
.. code-block:: Python
...
...
This diff is collapsed.
Click to expand it.
src/finam/sdk/component.py
+
8
−
7
View file @
8b6d7c69
...
...
@@ -31,7 +31,7 @@ class Component(IComponent, Loggable, ABC):
See :doc:`/finam-book/development/special_components`.
For components with a time step, use :class:`.TimeComponent`.
Derived classes overwrite these methods
Derived classes overwrite these methods
:
* :meth:`._initialize`
* :meth:`._connect`
...
...
@@ -289,17 +289,18 @@ class Component(IComponent, Loggable, ABC):
Raises
------
ValueError
If the name occurs in the inputs as well as the outputs
KeyError
If the name occurs neither in the inputs nor the outputs
If the name occurs in the inputs as well as the outputs,
or neither in the inputs nor the outputs.
"""
if
name
in
self
.
inputs
:
if
name
in
self
.
outputs
:
msg
=
f
"
Name `
{
name
}
` exists in inputs as well as outputs of component
{
self
.
name
}
"
if
self
.
status
==
ComponentStatus
.
CREATED
:
raise
KeyError
(
msg
)
with
ErrorLogger
(
self
.
logger
):
raise
KeyError
(
f
"
Name `
{
name
}
` exists in inputs as well as outputs of component
{
self
.
name
}
"
)
raise
KeyError
(
msg
)
return
self
.
inputs
[
name
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment