Skip to content

Commit

Permalink
Merge pull request #145 from wright-group/codeql_warnings
Browse files Browse the repository at this point in the history
CodeQL identified error/warning changes
  • Loading branch information
kameyer226 committed Oct 20, 2021
2 parents 7b52903 + c17dc64 commit 8387518
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

## [Unreleased]

### Fixed
- Resolve some issues discovered by CodeQL which could result in unexpected behavior

## [0.4.3]

### Added
Expand Down
2 changes: 1 addition & 1 deletion attune/_arrangement.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def independent(self):
out = np.unique(
np.concatenate([t.independent for t in self._tunes.values() if isinstance(t, Tune)], 0)
)
tol = tol = 1e-3 * (self.ind_max - self.ind_min)
tol = 1e-3 * (self.ind_max - self.ind_min)
diff = np.append(tol * 2, np.diff(out))
out = out[diff > tol]
out = out[out <= self.ind_max]
Expand Down
1 change: 0 additions & 1 deletion attune/_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def items(self):

def keys(self):
"""Settable keys in the Note."""
return self.setable_positions.items()
return self.setable_positions.keys()

def values(self):
Expand Down
4 changes: 4 additions & 0 deletions attune/io/topas4.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def from_topas4(topas4_folder):
if a["GUID"] == opt_dev_active_guid:
opt_dev_active = a["OpticalDevices"]
break
else:
raise ValueError("Active optical device GUID not found")

sep_dev_active_guid = sep_dev.get("ActiveConfigurationGUID")
sep_dev_conf = sep_dev["Configurations"]
Expand All @@ -40,6 +42,8 @@ def from_topas4(topas4_folder):
if a["GUID"] == sep_dev_active_guid:
sep_dev_active = a["SeparationDevices"]
break
else:
raise ValueError("Active separation device GUID not found")

arrangements = {}
setables = {}
Expand Down

0 comments on commit 8387518

Please sign in to comment.