Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Malte R
graph-tool
Commits
5549a7d6
Commit
5549a7d6
authored
Sep 15, 2020
by
Tiago Peixoto
Browse files
Raise exception if zstandard module is not available
parent
a405ceb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/__init__.py
View file @
5549a7d6
...
...
@@ -2869,7 +2869,7 @@ class Graph(object):
try
:
cctx
=
zstandard
.
ZstdDecompressor
()
except
NameError
:
raise
NotImplementedError
(
"zstandard module not installed"
)
raise
NotImplementedError
(
"zstandard module not installed
, but it's required for decompression
"
)
fctx
=
contextlib
.
ExitStack
()
f
=
open
(
file_name
,
mode
=
"rb"
)
fctx
.
enter_context
(
f
)
...
...
@@ -2963,7 +2963,7 @@ class Graph(object):
try
:
cctx
=
zstandard
.
ZstdCompressor
(
level
=
19
)
except
NameError
:
raise
NotImplementedError
(
"zstandard module not installed"
)
raise
NotImplementedError
(
"zstandard module not installed
, but it's required for compression
"
)
fctx
=
contextlib
.
ExitStack
()
f
=
open
(
file_name
,
mode
=
"wb"
)
fctx
.
enter_context
(
f
)
...
...
src/graph_tool/collection/netzschleuder.py
View file @
5549a7d6
...
...
@@ -64,7 +64,10 @@ def get_ns_network(k, token=None):
url
=
f
"
{
url_prefix
}
/net/
{
k
[
0
]
}
/files/
{
k
[
1
]
}
.gt.zst"
with
open_ns_file
(
url
,
token
)
as
f
:
cctx
=
zstandard
.
ZstdDecompressor
()
try
:
cctx
=
zstandard
.
ZstdDecompressor
()
except
NameError
:
raise
NotImplementedError
(
"zstandard module not installed, but it's required for zstd de-compression"
)
with
cctx
.
stream_reader
(
f
)
as
fc
:
g
=
load_graph
(
fc
,
fmt
=
"gt"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment