Skip to content

Commit

Permalink
FIX: enable adjustment of SNR for patch sources (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
astudenova authored Oct 9, 2024
1 parent 3f7b395 commit 406027b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/meegsim/_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def check_extents(extents, n_sources):
for extent in extents:
if extent is not None:
# Check if each extent is a number
if not isinstance(extent, (int, float)):
if not isinstance(extent, (int, float, np.integer, np.floating)):
raise ValueError(f"Extent {extent} must be a number.")

# Check if each extent is positive
Expand Down
4 changes: 4 additions & 0 deletions src/meegsim/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ def add_patch_sources(
self._source_groups.append(patch_sg)
self._sources.extend(patch_sg.names)

# Check if SNR should be adjusted
if patch_sg.snr is not None:
self.is_snr_adjusted = True

# Return the names of newly added sources
return patch_sg.names

Expand Down

0 comments on commit 406027b

Please sign in to comment.