Skip to content

Commit

Permalink
Cleanup before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
whohensee committed Jun 28, 2024
1 parent 26764bd commit 7bb992e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions models/cutouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ def save(self, filename=None, overwrite=True, **kwargs):
# make sure to also save using the FileOnDiskMixin method
FileOnDiskMixin.save(self, fullname, overwrite=overwrite, **kwargs)

# WHPR this might be able to become a class method... Is that better?
def _load_dataset_dict_from_hdf5(self, file, groupname):
"""Load the dataset from an HDF5 group into one co_subdict and return.
Expand Down Expand Up @@ -404,7 +403,7 @@ def load(self, filepath=None):
self.co_dict = Co_Dict()
self.co_dict.cutouts = self

if os.path.exists(filepath): # WHPR revisit this check... necessary?
if os.path.exists(filepath):
if self.format == 'hdf5':
with h5py.File(filepath, 'r') as file:
# quirk: the resulting dict is sorted alphabetically... likely harmless
Expand Down
3 changes: 1 addition & 2 deletions models/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ def __setattr__(self, key, value):
value = np.array(value)

if key in ['center_x_pixel', 'center_y_pixel'] and value is not None:
value = int(round(value)) # improc/tools::make_cutouts uses np.round()
# should I change to match?
value = int(np.round(value))

super().__setattr__(key, value)

Expand Down

0 comments on commit 7bb992e

Please sign in to comment.