Skip to content

Commit

Permalink
Adjust identifier sel
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeilstenedmands committed Oct 10, 2023
1 parent 5deb378 commit 9351434
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/dials/array_family/h5_flex_table_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,23 @@ def size(self):
return n

def select_on_experiment_identifiers(self, list_of_identifiers):
for identifier in self._identifier_to_file_map.keys():
for identifier in list(self._identifier_to_file_map.keys()):
if identifier not in list_of_identifiers:
file = self._identifier_to_file_map[identifier]
"""file = self._identifier_to_file_map[identifier]
handle = self._file_to_handle_map[file]
handle.close()
del self._file_to_handle_map[file]
del self._file_to_handle_map[file]"""
del self._identifier_to_cumulative_selection[identifier]
del self._identifier_to_table_map[identifier]
del self._identifier_to_initial_size_map[identifier]
del self._experiment_identifiers[identifier]
for k, v in zip(
list(self._experiment_identifiers.keys()),
list(self._experiment_identifiers.values()),
):
if v == identifier:
del self._experiment_identifiers[k]
del self._identifier_to_file_map[identifier]
# now if no more identifiers point to that file - close the handle?
# FIXME update experiment_identifiers?
return self

Expand Down Expand Up @@ -354,12 +360,15 @@ def keys(self):

@property
def flags(self):
return flex.reflection_table.flags
id_0 = list(self._identifier_to_table_map.keys())[0]

return self._identifier_to_table_map[id_0].flags

def get_flags(self, *args, **kwargs):
table = flex.reflection_table([])
table["flags"] = self["flags"]
return table.get_flags(*args, **kwargs)
res = table.get_flags(*args, **kwargs)
return res

def unset_flags(self, sel, flags):
id_0 = list(self._identifier_to_table_map.keys())[0]
Expand Down

0 comments on commit 9351434

Please sign in to comment.