Skip to content

Error Reference

Last Updated: 2026-11-03

This reference explains common errors and how to correct their inputs. Environment errors use the codes below; other validation errors name the calling function and offending argument or shape.

Catching neurospatial errors

Import NeurospatialError from the package root to catch the errors neurospatial raises for its own reasons:

from neurospatial import NeurospatialError

try:
    distances = env.distance_to(region="hom")
except NeurospatialError as exc:
    print(exc)

If the environment contains a region named home, the error suggests Fix: pass region='home'. If the region is missing, build a replacement collection:

from neurospatial import Regions

regions = Regions(env.regions.values())
regions.add("home", point=(x, y))  # Or pass polygon=... instead.
env = env.with_regions(regions)

Concrete exceptions inherit their standard Python type first, followed by NeurospatialError, so existing catch blocks continue to work:

Exception Standard Python bases Use
InputError ValueError An argument a public function cannot use: times and positions of different lengths or out of order, a selection that leaves no usable sampling interval (for example times in milliseconds), unit_ids of the wrong length, spike counts and rate maps with different numbers of neurons. See InputError
RegionNotFoundError KeyError, ValueError Unknown region name anywhere a region is looked up by name, including env.regions[name]; suggests the closest existing name
BinIndexOutOfRangeError ValueError Graph-query bin index outside [0, env.n_bins)
IncompatibleEnvironmentError ValueError Incompatible dimensions or decoding model bins
LayoutNotBuiltError RuntimeError Access to layout geometry before build()
CartesianOnlyError TypeError An operation that reads positions as Cartesian (x, y) called on a polar environment
DatasetCheckError ValueError A dataset session whose spikes, events or epochs disagree with its tracking clock ("clock"), or whose position span or sampling rate disagrees with the stated apparatus ("units"). The message names each failed check with its numbers and the accept_failed_checks= value that loads the session anyway, keeping the failure in rec.failed_checks. Import it from neurospatial.datasets

Two kinds of environment cannot run some analyses, and each kind has one error type:

  • A polar environment (from_polar_egocentric) raises CartesianOnlyError for every operation that reads its (distance, angle) bins as Cartesian positions, for example subset, interpolate, wall-based border scores or time_allocation="linear". Containment lookups such as bin_at and contains read (distance, angle) rows and work on polar environments.
  • An environment whose geometry lacks what the computation needs raises NotImplementedError: for example the 2D spatial_autocorrelation and grid scores on a hexagonal, mesh, track or 3-D environment, wall geometry outside 2-D, bin_at(), contains() and the other position lookups on a track built without track_width, or rebin on bins that are not a rectangular grid. The message names an alternative that works on that environment.

Graph-query indices previously raised IndexError; catch BinIndexOutOfRangeError or ValueError for those calls. except NeurospatialError does not catch everything: an argument of the wrong type or kind raises a plain TypeError (see wrong-kind inputs), and some value checks still raise a plain ValueError. except ValueError catches every InputError too.

Diagnostics describe what is wrong, why it matters and a corrected call using the Fix: label (formerly HOW:). Shared trajectory validation reports shape, length and timestamp problems together. RegionNotFoundError prints its message without KeyError's quotes; bare KeyError messages include their fix as a final sentence.

A few missing arguments raise a TypeError that says what is missing, why it is needed and how to fix the call: bin_size in Environment.from_samples, frame_times in env.animate_fields, and env left out of an encoding or decoding call. An env passed after the data gets the same kind of message when the call is then short of an argument, as in decode_position(counts, env, dt=dt). Other missing arguments and misspelled keywords keep Python's own TypeError (Python 3.13 and later add the likely spelling of a misspelled keyword). An option passed by position where the function takes it only by keyword raises a TypeError that names the keyword to use. Signatures are the functions' own.

Warnings also use concrete fixes. A bin_size that covers every data axis warns about a possible units mismatch, and peri-event windows wider than 60 seconds suggest window=(-0.5, 1.0) when milliseconds were intended. Large-grid warnings are visible UserWarnings; the existing hard memory ceiling still applies.


InputError

InputError means an argument could not be used as given. Its message says what is wrong, why it matters, and how to fix the call:

InputError: Invalid times/positions passed to compute_spatial_rate():
- times and positions must have the same length; times has 995 samples, positions has 1000.
Why: each interval [times[k], times[k+1]) is weighted by its duration, so mis-shaped, unsorted or repeated timestamps give wrong numbers.
Fix: pass times as a sorted 1-D array of numeric timestamps in seconds, without repeats, with one numeric positions row per timestamp.

The common causes:

  • No usable sampling interval. times in milliseconds (or the integer nanoseconds of a pd.DatetimeIndex) make every frame look like a long recording gap; epochs on another clock select no recorded time; every position is NaN or outside the environment; min_speed is above every speed. Any of these would return an empty map or all-NaN values, so the call refuses them. Convert times to seconds ((index - index[0]).total_seconds() for a DatetimeIndex), or fix the gate the message names.
  • times and positions that do not match. Different lengths, repeated or unsorted timestamps, or the two arguments swapped. Every problem is listed in one message.
  • Unit labels. unit_ids of the wrong length, repeated, or missing.
  • Population mismatch. Spike counts and rate maps with different numbers of neurons.
  • Units of angles and time bins. An angular bin_size wider than half a circle, a decoding dt in milliseconds, or detect_laps in a space with no loop.
from neurospatial import InputError

try:
    rates = compute_spatial_rates(env, spike_times, times_ms, positions)
except InputError as exc:
    print(exc)  # names the gate and the fix

Wrong-kind inputs

Passing a population where one unit is expected, or a result where an array is expected, raises TypeError naming the call that takes it:

Call Message starts with Fix
compute_spatial_rate(env, [train_a, train_b], times, positions) (also is_place_cell and the other single-unit functions; equal-length trains stacked in a 2-D array too) compute_spatial_rate() takes one unit's spike times; got 2 trains. compute_spatial_rates(...) for a population, or spike_times[i]
decode_position(env, [train_a, train_b], rates, dt=dt) decode_position() takes a spike count matrix ... got 2 spike trains. bin them first: counts, bin_edges = bin_spikes_in_time(spike_times, dt=dt)
decode_position(env, bin_spikes_in_time(...), rates, dt=dt) decode_position() got a tuple for spike_counts unpack the (counts, bin_edges) pair
spatial_information(r, occupancy=r.occupancy) with a rate result r spatial_information() got a SpatialRateResult for firing_rate r.spatial_information()
decode_position(env, counts, rates[0], dt=dt) decode_position() got a SpatialRateResult for encoding_models the population result from compute_spatial_rates
population_coverage(env, rates, bandwidth=...) population_coverage() got a SpatialRatesResult for firing_rates rates.firing_rates
BayesianDecoder(env).fit(counts, times, positions) with a count matrix BayesianDecoder.fit() takes spike times ... looks like a spike count matrix. decode_position(env, counts, rates, dt=dt)

A misspelled keyword or option names the closest valid one:

TypeError: open_field_session() got an unexpected keyword argument 'n_plce_cells'. Did you mean 'n_place_cells'?
ValueError: compute_spatial_rate() got method='gaussian'; method must be one of 'diffusion_kde', 'gaussian_kde', 'binned', 'glm'. Did you mean 'gaussian_kde'?

What raises and what warns

Situation Behavior
The input cannot mean what was asked (wrong kind, wrong shape, a unit that cannot be right, no usable sampling interval) Raises (InputError, TypeError or another ValueError)
Part of the input is discarded or looks mis-scaled, but a result remains (more than 5% of spikes outside the tracked time, runs of removed samples, a bandwidth far below the bin size) One UserWarning per call naming every problem; silence it with warn_on_drop=False where the function has that argument
A deliberately empty selection (epochs or spike_window given as an Intervals with no rows, such as a condition with no trials) UserWarning; the result is empty or NaN, which is the answer
A result that stays meaningful without any usable interval: a label of compute_directional_place_fields with no analyzable time (a NaN map with zero occupancy, no warning), add_positions (an event at a sample's own time keeps that position), heading_from_velocity(allow_all_nan=True), animation overlays and decoding ground truth (exact samples only) The call returns, with a UserWarning naming the gate (none for a place-field label)

warn_on_drop=False never silences a refusal: a call with no usable interval raises whatever its value.


Quick Index

Code Error Severity Section
E1001 No active bins found Critical Environment Creation
E1002 Invalid bin_size Critical Environment Creation
E1003 Dimension mismatch Critical Environment Compatibility
E1005 Path traversal detected Critical I/O Errors
E1006 Environment constructed directly Critical Environment Creation

Environment Creation Errors

E1001: No active bins found

Error Message Example:

ValueError: [E1001] No active bins found after filtering.

Diagnostics:
  Data range: [(0.0, 100.0), (0.0, 100.0)]
  Data extent: [100.0, 100.0]
  Number of samples: 500
  bin_size: 200.0
  Grid shape: (1, 1)
  bin_count_threshold: 1

Possible solutions:
  1. Reduce bin_size (try bin_size=10.0 for this data range)
  2. Lower bin_count_threshold (try bin_count_threshold=0)
  3. Enable morphological operations (dilate=True, fill_holes=True)
  4. Check that dimension_ranges match your data

What This Means:

The environment creation process couldn't find any spatial bins that meet the filtering criteria. This happens when:

  1. bin_size is too large - The bin_size creates too few bins and they get filtered out
  2. bin_count_threshold is too high - Bins need more samples than available to be "active"
  3. Data is too sparse - Not enough samples to activate bins across the space
  4. Morphological filtering is too aggressive - Holes/gaps leave no active bins

Solutions:

Solution 1: Reduce bin_size (Most Common)

# ❌ Too large - creates only 1 bin
env = Environment.from_samples(positions, bin_size=200.0)

# ✓ Better - creates ~100 bins
env = Environment.from_samples(positions, bin_size=10.0, units='cm')

Rule of thumb: For data spanning 0-100 in each dimension, try bin_size = data_range / 20 as a starting point.

Solution 2: Lower bin_count_threshold

# ❌ Too strict - requires many samples per bin
env = Environment.from_samples(
    positions,
    bin_size=5.0,
    bin_count_threshold=10  # Need 10+ samples per bin
)

# ✓ More lenient - accept bins with fewer samples
env = Environment.from_samples(
    positions,
    bin_size=5.0,
    bin_count_threshold=1,  # Accept bins with 1+ sample
    units='cm'
)

Solution 3: Enable morphological operations

# ❌ Gaps in coverage leave disconnected regions
env = Environment.from_samples(positions, bin_size=5.0)

# ✓ Fill in gaps and holes
env = Environment.from_samples(
    positions,
    bin_size=5.0,
    dilate=True,        # Expand active regions
    fill_holes=True,    # Fill enclosed gaps
    units='cm'
)

Solution 4: Check your data

# Inspect data range
print(f"X range: {positions[:, 0].min():.2f} to {positions[:, 0].max():.2f}")
print(f"Y range: {positions[:, 1].min():.2f} to {positions[:, 1].max():.2f}")

# Look for NaN values
nan_count = np.isnan(positions).sum()
if nan_count > 0:
    print(f"Warning: {nan_count} NaN values in positions")
    positions = positions[~np.any(np.isnan(positions), axis=1)]

See Also: - Environment.from_samples() documentation - Quickstart Guide


E1002: Invalid bin_size

Error Message Example:

ValueError: [E1002] bin_size must be positive and finite, got -5.0.
Why: cell widths must be finite and positive in every spatial dimension.
Fix: pass e.g. bin_size=2.0, in the same units as the positions

What This Means:

The cell size has an invalid value. Every layout checks its cell size the same way: bin_size, hexagon_width, point_spacing and pixel_size. Valid values must be:

  1. Positive numbers - Negative or zero sizes are meaningless
  2. Finite - Not NaN or infinity
  3. Numeric - A single number (a NumPy scalar works) or one number per dimension; strings and booleans are refused with TypeError

Solutions:

Solution 1: Use positive bin_size

# ❌ Negative bin_size
env = Environment.from_samples(positions, bin_size=-5.0)

# ✓ Positive bin_size
env = Environment.from_samples(positions, bin_size=5.0, units='cm')

Solution 2: Check for NaN/inf

# ❌ Invalid numeric value
bin_size = np.nan  # or np.inf
env = Environment.from_samples(positions, bin_size=bin_size)

# ✓ Valid numeric value
bin_size = 5.0
env = Environment.from_samples(positions, bin_size=bin_size, units='cm')

Solution 3: Use correct sequence format

# ❌ Wrong type
env = Environment.from_samples(positions, bin_size="5.0")

# ✓ Single numeric value
env = Environment.from_samples(positions, bin_size=5.0, units='cm')

# ✓ Sequence for per-dimension bin sizes
env = Environment.from_samples(
    positions,
    bin_size=[5.0, 10.0],  # Different size per dimension
    units='cm'
)

Common Mistakes:

  • Using string instead of number: bin_size="5" → use bin_size=5.0
  • Forgetting units: Always specify units='cm' or appropriate unit
  • Mixing up bin_size with number of bins: bin_size is spatial extent, not count

See Also: - Environment.from_samples() documentation - Layout validation module


E1006: Environment constructed directly

Error Message:

ValueError: [E1006] Environment cannot be constructed directly; use a factory method.
Why: a factory builds the geometry and connectivity an Environment needs from the data you have.
Fix: env = Environment.from_samples(positions, bin_size=2.0) for recorded positions; or from_polygon (a Shapely boundary), from_graph (a track graph), from_grid_mask (a boolean grid) or from_pixel_mask (an image mask). See https://edeno.github.io/neurospatial/errors/#e1006-environment-constructed-directly
Cause: Environment() was called directly. Environment is always built through a factory that constructs the underlying layout/connectivity.

Solution: Use the factory matching your data:

env = Environment.from_samples(positions, bin_size=2.0)   # position samples
# or from_polygon / from_graph / from_grid_mask / from_pixel_mask


Environment Compatibility Errors

E1003: Dimension mismatch

Error Message Example:

ValueError: [E1003] All sub-environments must share the same n_dims.
Env 0 has 2 dimensions, Env 1 has 3 dimensions.

Cannot combine environments with incompatible dimensionality.

Suggested fixes:
  1. Ensure all environments use the same dimensional data
  2. Verify each environment's n_dims property before creating the composite

What This Means:

You're trying to combine or compare environments with different dimensionality (e.g., mixing 2D and 3D environments). This error commonly occurs when:

  1. Calling Environment.combine - All sub-environments must have same n_dims
  2. Comparing environments - Alignment/comparison requires matching dimensions
  3. Stacking environments - Cannot stack environments of different dimensionality

Solutions:

Solution 1: Check dimensions before combining

# ❌ Mixing 2D and 3D environments
env_2d = Environment.from_samples(positions_2d, bin_size=5.0)  # shape (N, 2)
env_3d = Environment.from_samples(positions_3d, bin_size=5.0)  # shape (N, 3)

composite = Environment.combine({"first": env_2d, "second": env_3d})  # Error!

# ✓ Check dimensions first
print(f"env_2d dimensions: {env_2d.n_dims}")  # 2
print(f"env_3d dimensions: {env_3d.n_dims}")  # 3

# Only combine disjoint environments with matching dimensions, units and frame
composite = Environment.combine({"first": env_2d, "second": env_2d_another})

Solution 2: Project 3D to 2D

# If you need to combine 3D with 2D, project first
positions_3d_projected = positions_3d[:, :2]  # Take only x, y (drop z)

env_2d_projected = Environment.from_samples(
    positions_3d_projected,
    bin_size=5.0,
    units='cm'
)

# Now can combine with other 2D environments
composite = Environment.combine({"first": env_2d, "second": env_2d_projected})

Solution 3: Create separate composites per dimensionality

# Group environments by dimensionality
envs_2d = [env1, env2, env3]  # All 2D
envs_3d = [env4, env5]  # All 3D

# Create separate composites
composite_2d = Environment.combine({str(i): env for i, env in enumerate(envs_2d)})
composite_3d = Environment.combine({str(i): env for i, env in enumerate(envs_3d)})

See Also: - Combining environments - 3D Environment Support


I/O Errors

E1005: Path traversal detected

Error Message Example:

ValueError: [E1005] Path traversal detected in path: ../shared/my_environment.
Environment save and load paths may not contain '..' components; name the
location directly, for example with an absolute path.

For more information, see: https://edeno.github.io/neurospatial/errors/#e1005-path-traversal-detected

What This Means:

to_file and from_file (and Environment.to_file / Environment.from_file) refuse a path that contains a .. (parent directory) component.

Why This Is Refused:

This is input hygiene: a path written with .. depends on the current working directory and hides where the files go. It is not a security boundary. Only literal .. components are refused; an absolute path or a symbolic link can still name any location. If your code saves or loads paths supplied by someone else, check that they stay inside the directory you intend, for example by comparing Path(p).resolve() with your base directory using Path.is_relative_to.

Solutions:

Solution 1: Use a relative path without '..'

# Refused
env.to_file("../shared/my_environment")

# Accepted
env.to_file("my_environment")
env.to_file("outputs/my_environment")

Solution 2: Use an absolute path

from pathlib import Path

save_dir = Path("/Users/researcher/data/environments")
env.to_file(save_dir / "my_environment")

See Also: - I/O Module Documentation - Environment serialization API


Data discarded at the boundary

Some inputs run to completion but quietly lose or mis-scale part of the data, which gives a plausible but wrong result. neurospatial warns when more than 5% of the input is discarded, and refuses inputs that cannot mean what was asked, including a selection that leaves no usable sampling interval. Each message says what was lost, the likely cause and the fix.

Message starts with Raised by Likely cause Fix
Interval filtering excluded ALL trajectory intervals (InputError) Every analysis that gates sampling intervals (rate maps, env.occupancy, decoders, behavior detectors), when no interval is left times in milliseconds or a DatetimeIndex, epochs on another clock, positions all NaN or outside the environment, min_speed above every speed Fix the gate the message names; warn_on_drop=False does not silence it. A deliberately empty Intervals selection warns instead
About P% of the analysed time is in runs of removed samples (UserWarning) Spatial rate maps, env.occupancy and the other analyses that bridge gaps, when the kept intervals bridge runs of removed samples lasting 0.25 s to max_gap that add up to more than 5% of the analysed time (not checked with max_gap=None) times and positions boolean-masked, for example times[speed > 5], or tracking frames dropped, for example df[df.likelihood > 0.9] during occlusions: runs shorter than max_gap are bridged, so the time and spikes inside them still count For masked samples, pass the full arrays and select with the function's min_speed= or epochs= where it has them. For dropped tracking frames, bridging is intended up to max_gap; to exclude them instead, pass a max_gap below the shortest removed run. Silence with warn_on_drop=False where the function has it
N/M spike_times (P%) fell outside the position time window (UserWarning) compute_spatial_rate(s), compute_directional_rate(s), decode_session and the other rate maps, when more than 5% of spikes fall outside [times[0], times[-1]). With epochs or spike_window, only spikes inside them count, so sleep spikes outside epochs=wake are not lost. All spikes count when the spikes look like another clock: their span and largest value both about 1000 times (or 1/1000 of) those of times (one of them in milliseconds); spike times that span more than about 32 times the tracked time and reach more than about 32 times every time and window bound (32 is the geometric midpoint of 1 and 1000); or no spike inside the tracked time (an offset clock). A unit with tracked spikes but none inside the windows is silent there and does not warn. Spikes outside epochs and spike_window are not checked, so an offset that leaves some spikes inside them goes unreported: compare spike_times.min() and .max() with times yourself Spike times and position times on different clocks or in different units Put both on one clock in seconds. Silence with warn_on_drop=False once the drop is intended
N/M spikes (P%) mapped to positions outside the active environment bins (UserWarning) Spatial spike binning, when more than 5% of spikes land outside the environment Positions in another unit or frame than the environment Convert positions to env.units. Silence with warn_on_drop=False
bandwidth=B is far below the L bin size (UserWarning) Spatial rate maps, when an explicit bandwidth is below a quarter of the median bin length A bandwidth in metres on a cm environment Pass bandwidth in env.units, or method="binned", bandwidth=0 for no smoothing
bin_size=S rad is wider than half a circle (InputError) compute_directional_rate(s), head_direction_cell_significance, is_head_direction_cell A bin size in degrees with the default angle_unit="rad" Pass angle_unit="deg"
bin_size=S rad leaves N heading bins, fewer than eight (UserWarning) The same directional functions, when bin_size is wider than π/4 A bin size of a few degrees with the default angle_unit="rad" (bin_size=3 gives two bins) Pass angle_unit="deg", or a narrower bin size
bandwidth=B rad is wider than 1 radian (UserWarning) The same directional functions A bandwidth in degrees with the default angle_unit="rad" Pass angle_unit="deg", or a narrower bandwidth
decode_position: N of M bins have rate 0 for every neuron (UserWarning) decode_position, decode_position_summary and BayesianDecoder.predict, when raw rates without a prior or spatial_support have more than 5% all-zero bins Missing rates filled with zero (np.nan_to_num(rates.firing_rates)) Pass the rate result itself, or prior=rates.spatial_support * env.bin_sizes; for a decoder, BayesianDecoder.from_rates(rates) or from_models(..., spatial_support=...)
decode_position: dt=D s is R times the S s spacing of times (InputError) decode_position, decode_position_summary, when dt is longer than 1 s and at least 1000 times the median spacing of times, or 5 s or longer and at least 100 times it: a dt typed in milliseconds (5 to 250) over steps of 0.5 to 25 ms is at least 200 steps read as seconds, while valid windows over 1 s are short of 5 s and rarely 1000 steps dt in milliseconds Pass dt in seconds (dt=0.025 for 25 ms). A dt of 1 s or less is never refused, and overlapping windows (600 ms stepped by 1 ms, 2 s stepped by 10 ms, 3 s stepped by 5 ms) are accepted
bin_spikes_in_time: dt=D s is longer than 1 second (UserWarning) bin_spikes_in_time, decode_position, decode_position_summary, decode_session and BayesianDecoder.predict, when dt > 1 dt in milliseconds Pass dt in seconds, for example dt=0.025
detect_laps(method='auto') counts laps around a loop, but this environment has no loop (InputError) detect_laps with method="auto" or "region" on a space without a loop: a track graph without a cycle, or a 2-D area without a hole whose inscribed circle has a radius above one bin (positions binned with from_samples shrink a ring's hole by up to a bin on each side). Short cycles of the bin graph (grid neighbours, the bins at a junction) are not loops. A 3-D environment is refused too A linear track, a tree, plus or W maze, or an open arena Use detect_trials(env, times, positions, regions=[start, end]), or method="reference" with reference_lap=

A call warns at most once: when it finds several problems, one warning names them all.

Positions in the wrong units (pixels on a cm environment) raise InputError when every sample falls outside the environment. When only part of them does, they have no warning of their own: they show up as a large result.n_spikes_outside_intervals and a low total occupancy, because the samples outside the environment are dropped. Compare the range of positions with env.dimension_ranges when either looks wrong.

Filtering by speed with NaN instead of deleted rows (positions[speed < 5] = np.nan) is not detected. NaN rows are treated exactly like deleted rows, so short NaN runs are bridged as occupancy in the same way, but they look like ordinary lost tracking. Select running samples with min_speed= (or epochs=) instead of masking the arrays yourself.

spatial_information, sparsity, selectivity and information_per_second take occupancy by keyword (spatial_information(rate, occupancy=occupancy)). A rate map and its occupancy have the same shape, so a swapped positional pair would return a wrong number; passing it positionally raises TypeError.


Getting Help

If you encounter an error not listed here:

  1. Check the full error message - Modern errors include diagnostic information
  2. Search the documentation - Use the search bar at the top
  3. Check GitHub Issues - Someone may have encountered this before: neurospatial/issues
  4. Ask for help - Create a new issue with:
  5. Full error message
  6. Minimal code to reproduce
  7. Data shapes and types
  8. Expected vs actual behavior

Reporting New Errors

If you find an error that should be documented here:

  1. Open an issue on GitHub
  2. Tag it with documentation and error-reference
  3. Include the error code (if present) and full message
  4. Describe what you were trying to do
  5. Suggest a solution if you found one

Error Code Guidelines (For Developers)

Adding New Error Codes

When adding new error codes to the codebase:

  1. Choose the next available code in the appropriate range:
  2. E1xxx: Environment creation/initialization errors
  3. E2xxx: Data validation errors
  4. E3xxx: Operation/method call errors
  5. E4xxx: I/O and serialization errors
  6. E5xxx: Layout engine errors

  7. Format error messages:

    raise ValueError(
        f"[E1001] Brief error description.\n\n"
        f"Diagnostic information here...\n\n"
        f"For more information, see: "
        f"https://edeno.github.io/neurospatial/errors/#e1001"
    )
    

  8. Document the error in this file with:

  9. Error code and title
  10. What it means
  11. Common causes
  12. At least 3 solutions with code examples
  13. Links to relevant documentation

  14. Add test coverage:

    def test_error_code_appears_in_message():
        with pytest.raises(ValueError, match=r"\[E1001\]"):
            # Code that triggers error
    


Last Updated: 2025-11-14 Version: 1.0 Feedback: GitHub Issues