simonsobs / simonsobs/sotodlib

SignalCut add_obs tries to append to a numpy array

Open
#638 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
19
Forks
23
Avg merge
1d 5h
Merged PRs (30d)
14

Description

While trying to run MLmapmaker with the soconda environment on NERSC I got the following error:

TOAST ERROR: Proc 0: Traceback (most recent call last):
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/toast/mpi.py", line 515, in exception_guard
    yield
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/sotodlib/toast/workflows/toast_so_map.py", line 694, in cli
    main()
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/sotodlib/toast/workflows/toast_so_map.py", line 680, in main
    reduce_data(job, args, data)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/sotodlib/toast/workflows/toast_so_map.py", line 548, in reduce_data
    ops.mlmapmaker.apply(data)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/toast/timing.py", line 107, in df
    return f(*args, **kwargs)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/toast/ops/operator.py", line 107, in apply
    self.exec(data, detectors, use_accel=use_accel, **kwargs)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/toast/timing.py", line 107, in df
    return f(*args, **kwargs)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/toast/ops/operator.py", line 47, in exec
    self._exec(
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/toast/timing.py", line 81, in df
    return f(*args, **kwargs)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/sotodlib/toast/ops/mlmapmaker.py", line 419, in _exec
    self._mapmaker.add_obs(
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/sotodlib/mapmaking.py", line 80, in add_obs
    signal.add_obs(id, obs, nmat, tod)
Proc 0:   File "/global/common/software/sobs/perlmutter/conda_envs/soconda_20230928_0.0.5/lib/python3.10/site-packages/sotodlib/mapmaking.py", line 336, in add_obs
    self.rhs.append(obs_rhs)
Proc 0: AttributeError: 'numpy.ndarray' object has no attribute 'append'

In SignalCut class, self.rhs is a list initially (line 293), and changes to a numpy array in method prepare (line 320).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read SignalCut in sotodlib/mapmaking/ml_mapmaker.py, especially its prepare and add_obs methods at the referenced lines. Reproduce the MLmapmaker workflow that triggers the traceback, then verify that add_obs completes without the numpy.ndarray append error.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.