Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
plotID_python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plotID
plotID_python
Commits
960060fb
Commit
960060fb
authored
2 years ago
by
Mayr, Hannes
Browse files
Options
Downloads
Patches
Plain Diff
Remove TypedDicts and type all **kwargs as Any.
parent
8c2eace9
No related branches found
No related tags found
1 merge request
!54
Resolve "Type hints"
Pipeline
#870864
passed
2 years ago
Stage: linting
Stage: testing
Stage: security
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
plotid/tagplot.py
+2
-12
2 additions, 12 deletions
plotid/tagplot.py
plotid/tagplot_image.py
+1
-1
1 addition, 1 deletion
plotid/tagplot_image.py
plotid/tagplot_matplotlib.py
+1
-1
1 addition, 1 deletion
plotid/tagplot_matplotlib.py
with
4 additions
and
14 deletions
plotid/tagplot.py
+
2
−
12
View file @
960060fb
...
...
@@ -11,7 +11,7 @@ Functions:
"""
import
warnings
from
typing
import
Literal
,
TypedDict
from
typing
import
Any
,
Literal
import
matplotlib.pyplot
as
plt
from
PIL.Image
import
Image
...
...
@@ -20,21 +20,11 @@ from plotid.tagplot_matplotlib import tagplot_matplotlib
from
plotid.tagplot_image
import
tagplot_image
kwargs_types
=
TypedDict
(
"
kwargs_types
"
,
{
"
prefix
"
:
str
,
"
id_method
"
:
Literal
[
"
time
"
,
"
random
"
],
"
qrcode
"
:
bool
,
},
)
def
tagplot
(
figs
:
plt
.
Figure
|
Image
|
list
[
plt
.
Figure
|
Image
],
engine
:
Literal
[
"
matplotlib
"
,
"
image
"
],
location
:
str
=
"
east
"
,
**
kwargs
:
kwargs_types
,
**
kwargs
:
Any
,
)
->
PlotIDTransfer
:
"""
Tag your figure/plot with an ID.
...
...
This diff is collapsed.
Click to expand it.
plotid/tagplot_image.py
+
1
−
1
View file @
960060fb
...
...
@@ -29,7 +29,7 @@ def tagplot_image(plotid_object: PlotOptions) -> PlotIDTransfer:
# Check if plotid_object is a valid instance of PlotOptions
if
not
isinstance
(
plotid_object
,
PlotOptions
):
raise
TypeError
(
"
The given options container is not an instance
"
"
of PlotOptions.
"
"
The given options container is not an instance
of PlotOptions.
"
)
# Check if figs is a list of files
...
...
This diff is collapsed.
Click to expand it.
plotid/tagplot_matplotlib.py
+
1
−
1
View file @
960060fb
...
...
@@ -27,7 +27,7 @@ def tagplot_matplotlib(plotid_object: PlotOptions) -> PlotIDTransfer:
# Check if plotid_object is a valid instance of PlotOptions
if
not
isinstance
(
plotid_object
,
PlotOptions
):
raise
TypeError
(
"
The given options container is not an instance
"
"
of PlotOptions.
"
"
The given options container is not an instance
of PlotOptions.
"
)
# Check if figs is a list of valid figures
...
...
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