Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: enable adjustment of SNR for patch sources #39

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/meegsim/_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,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 @@ -176,6 +176,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