Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cb-util
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Christoph Alt
cb-util
Commits
0a1dbe9d
Commit
0a1dbe9d
authored
2 years ago
by
Christoph Alt
Browse files
Options
Downloads
Patches
Plain Diff
optionally use backport of importlib resources for json import
parent
a3bd8c69
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#51919
passed
2 years ago
Stage: test
Stage: deploy
Stage: trigger
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plotting/roofline.py
+7
-2
7 additions, 2 deletions
plotting/roofline.py
setup.py
+2
-1
2 additions, 1 deletion
setup.py
with
9 additions
and
3 deletions
plotting/roofline.py
+
7
−
2
View file @
0a1dbe9d
import
plotly.graph_objs
as
go
from
dataclasses
import
dataclass
import
json
import
importlib
try
:
import
importlib.resources
as
pkg_resources
except
ImportError
:
# Try backported to PY<37 `importlib_resources`.
import
importlib_resources
as
pkg_resources
@dataclass
...
...
@@ -19,7 +24,7 @@ DEFAULT_MARKER = dict(size=10, color='green')
def
get_data
(
file_name
=
"
roofline_data.json
"
):
with
importlib
.
resources
.
open_text
(
__package__
,
file_name
)
as
file
:
with
pkg_
resources
.
open_text
(
__package__
,
file_name
)
as
file
:
data
=
json
.
load
(
file
)
return
data
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
1
View file @
0a1dbe9d
...
...
@@ -23,7 +23,8 @@ setup(name="cb-util",
"
requests
"
,
"
plotly
"
,
"
kaleido
"
,
"
kadi-apy
"
"
kadi-apy
"
,
"
importlib_resources ; python_version<
'
3.7
'"
,
],
setup_requires
=
[
'
pytest-runner
'
],
tests_require
=
[
'
pytest
'
]
...
...
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