Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Packages
chemical_checker
Commits
7c2e1fb6
Commit
7c2e1fb6
authored
Nov 30, 2021
by
Martino Bertoni
🌋
Browse files
bugfix
parent
276a598b
Pipeline
#2581
passed with stages
in 19 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
package/chemicalchecker/util/sanitize/sanitizer.py
View file @
7c2e1fb6
...
...
@@ -137,9 +137,8 @@ class Sanitizer(object):
"present in reference: %s"
%
str
(
add_features
))
# we assume that features are in the same order
mask
=
np
.
isin
(
list
(
features
),
list
(
ref_features
))
with
h5py
.
File
(
data
,
"a"
)
as
hf
:
self
.
filter_h5_dataset
(
data
,
mask
,
axis
=
1
,
name
=
"V"
)
self
.
rewrite_features_h5
(
data
,
mask
)
data
.
filter_h5_dataset
(
'V'
,
keep
,
axis
=
1
)
data
.
filter_h5_dataset
(
'features'
,
keep
,
axis
=
1
)
# check features frequencies
if
self
.
check_features
:
...
...
@@ -266,11 +265,11 @@ class Sanitizer(object):
# return if input was raw data
if
not
was_data
:
with
h5py
.
File
(
data
,
"r"
)
as
hf
:
with
h5py
.
File
(
data
.
data_path
,
"r"
)
as
hf
:
V
=
hf
[
"V"
][:]
keys
=
hf
[
"keys"
][:].
astype
(
str
)
keys_raw
=
hf
[
"keys_raw"
][:].
astype
(
str
)
features
=
hf
[
"features"
][:].
astype
(
str
)
os
.
remove
(
data
)
os
.
remove
(
data
.
data_path
)
return
V
,
keys
,
keys_raw
,
features
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