ReceiptsRecorded runs, model-free verdicts
VERIFIED

astropy__ccdproc-867

VERIFIED on first verdict

1 attempt, 0 appeals. 1 file, 2 added and 2 removed lines. Tokens: 29,823 tokens. Model cost: $0.009. Sandbox time: 1 min 20 s.

The plan

Repository
astropy/ccdproc
Base commit
541f59e (image tag)
Issue
`subtract_overscan` incorrectly allows a numpy array as input See https://github.com/astropy/ccdproc/blob/main/ccdproc/core.py#L478 Both the docstring and code later in the function clearly assumes the thing passed in is a `CCDData` object.
Files to edit
  • ccdproc/core.py
Approach

Attempt 1

VERIFIED

Agent branch

KindCommandExitDurationDigest
commandgit ls-files -z
exact command
git ls-files -z
00.004sd48f5b22
writewrite ccdproc/core.py
exact command
/opt/receipts-7424f7f9a9814c448c55d09212c4e94d/bin/busybox sh -c 'mkdir -p /ccdproc/ccdproc && cp /opt/receipts-7424f7f9a9814c448c55d09212c4e94d/incoming/c15e44e74e83243cd00839500995cb5c10bb0d6ba74ffbf9ba34dca5e2f9f11e /ccdproc/ccdproc/core.py'
00.005sceedb162
commandpytest ccdproc/tests/test_ccdproc.py::test_subtract_overscan_fails -v
exact command
/opt/receipts-89c3488d1f304b85a3151d4e399b6792/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-89c3488d1f304b85a3151d4e399b6792/receipts_pytest.py ccdproc/tests/test_ccdproc.py::test_subtract_overscan_fails -v -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-3.xml
03.895s20c78829b684
commandpytest ccdproc/tests/test_ccdproc.py
exact command
/opt/receipts-b2390a72ed09415ca49677891655ef8f/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-b2390a72ed09415ca49677891655ef8f/receipts_pytest.py --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning ccdproc/tests/test_ccdproc.py -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/agent1-4.xml
04.056s20c78829b684
diffcapture patch
exact command
compute patch in executor staging agent1-052e4335ad1147f6b1d8dc426615f827: /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false add -A && /opt/homebrew/Cellar/git/2.53.0/bin/git -c core.hooksPath=/dev/null -c core.attributesFile=/dev/null -c diff.external= -c core.quotePath=false diff --cached --binary --no-ext-diff --no-textconv --no-renames 56f3b8d607404047c7e9ebf922b262be3758a0ee
00.043s20c78829b684
Finish summary
Modified subtract_overscan in ccdproc/core.py to reject numpy array inputs, enforcing CCDData only. Updated the type check at the start of the function and adjusted the error message. The problematic test now passes, and the full test suite continues to pass.
Worker outcome
finished
  • Target tests pass: yes
  • Full suite passes: yes
  • Files changed: ccdproc/core.py
  • Ran tests: yes

Witness branch w1

KindCommandExitDurationDigest
applyapply patch c96ee0e3a67c
exact command
git update-index -q --refresh; git apply -v --3way --recount --ignore-space-change --whitespace=nowarn /opt/receipts-3ca19699a61749cc84a9332a73abdf6a/incoming/c96ee0e3a67cc28e5a37b180ac26cb09daa40b7da27171d3aaf144ce3da5002f.diff
00.010s20c78829b684
verificationpytest (witness) ccdproc/tests/test_ccdproc.py
exact command
/opt/receipts-6fca8db6c0334f17a9dda4db22f2b662/bin/busybox mkdir -p /opt/receipts/reports && python -I /opt/receipts-6fca8db6c0334f17a9dda4db22f2b662/receipts_pytest.py --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning ccdproc/tests/test_ccdproc.py -o junit_family=xunit1 -p no:cacheprovider -rA --continue-on-collection-errors --junitxml=/opt/receipts/reports/w1-2.xml
04.116s20c78829b684

Gate predicate checklist

PredicateNameStatusEvidence
R1_fail_to_passFailing specification tests now passPASStarget tests passed: ccdproc/tests/test_ccdproc.py::test_subtract_overscan_fails
R2_pass_to_passPreviously passing tests keptPASS71 baseline-passing tests still pass
R3_no_shrinkNo removed tests or new skipsPASSall 72 baseline tests collected; skips unchanged (0)
R4_patch_scopePatch scopePASSpatch touches 1 file(s), all in scope
R5_provenanceWitness chain and patch digestPASSagent chain 876fad34 -> cd9720c0 unbroken over 5 receipt(s); witness chain 876fad34 -> f681ddc5 unbroken over 2 receipt(s); applied digest matches
R6_claim_auditAgent claim audit (advisory)PASSclaimed green; own last run: 72 passed, 0 failed

What it said

Finish summary
Modified subtract_overscan in ccdproc/core.py to reject numpy array inputs, enforcing CCDData only. Updated the type check at the start of the function and adjusted the error message. The problematic test now passes, and the full test suite continues to pass.
Worker outcome
finished
  • Target tests pass: yes
  • Full suite passes: yes
  • Files changed: ccdproc/core.py
  • Ran tests: yes

What the record shows

honest: claimed green; own last run: 72 passed, 0 failed

SWE-rebench's official grader: resolved

Agrees with the gate

Shipped patch

diff --git a/ccdproc/core.py b/ccdproc/core.pyindex eea5c03..c5266c3 100644--- a/ccdproc/core.py+++ b/ccdproc/core.py@@ -475,8 +475,8 @@ def subtract_overscan(     Spaces are stripped out of the ``fits_section`` string.      """-    if not (isinstance(ccd, CCDData) or isinstance(ccd, np.ndarray)):-        raise TypeError("ccddata is not a CCDData or ndarray object.")+    if not isinstance(ccd, CCDData):+        raise TypeError("ccddata is not a CCDData object.")      if (overscan is not None and fits_section is not None) or (         overscan is None and fits_section is None

Model and costs

Model
NVIDIA Nemotron 3 Super thinking off · temperature 1.0 · top_p 0.95
Tokens
29,823 tokens
Model cost
$0.009
Sandbox time
1 min 20 s
Sandbox cost
Token Factory reported cost: 0.238 (unit not published)
Full environment disclosure
{
  "executor_kind": "tokenfactory",
  "lock_sha256": "2b116279db27890f7f5267b5d66588187397ff52a7c02f9523498968ee09ef1b",
  "model": {
    "base_url": "https://api.tokenfactory.nebius.com/v1/",
    "client": "TokenFactoryClient",
    "max_tokens": null,
    "model": "nvidia/nemotron-3-super-120b-a12b",
    "temperature": 1.0,
    "thinking": false,
    "top_p": 0.95
  },
  "pytest_config_digests": {
    "ccdproc/conftest.py": "aa3aea0b3f1fca8146b7a68e0b337ff5fe838ebca43ff3e22edd444ae172c9b0",
    "pyproject.toml": "340e7f1b11e20d152c90a927bf0493c620da3926a92121adde26382856f34d31",
    "tox.ini": "9e5b84133ca6216f0505a6840beba67dd50ec822556f8d5fe547b05cde2623aa"
  },
  "receipts_version": "0.0.1",
  "test_digests": {
    "ccdproc/tests/__init__.py": "21c1ee488e2e5e7db9b2b8c024b4674fd94119246330b5157f08363230a36cff",
    "ccdproc/tests/data/README.rst": "b3f73f8d11a5ff3f6ae48baeb2239422ff2b3d076d904bf6f9f2a0dd992e1a6f",
    "ccdproc/tests/data/a8280271.fits": "f1a33e416b601c57a77893e11ab158e0216ab1f48c634adcabdb757d84111f02",
    "ccdproc/tests/data/expected_ifc_file_properties.csv": "4f41269d400f772b8adf6fdd4aa64f496b0b63a5f095eed7a0b6d407543e71a5",
    "ccdproc/tests/data/flat-mef.fits": "74a36c3645f0e099902d2353c40582a122307fa50be3d7f8082eca76dc91d3e4",
    "ccdproc/tests/data/science-mef.fits": "ea0b8ff20fac5ce9311529e6b7c50a0d9294a85e512db22e291f463f410c42ac",
    "ccdproc/tests/data/sip-wcs.fit": "73361e20ff496f8264ba114a675b9d5418769326d8986c5db87d92686cc1daca",
    "ccdproc/tests/make_mef.py": "e6a780751eb857d36304600ac3000050ac769230e6250d69a7c1f456d74eb627",
    "ccdproc/tests/pytest_fixtures.py": "624bb36608c5d70cd074e34164ef77601733c1123d0167db4892c842b1e314cc",
    "ccdproc/tests/run_for_memory_profile.py": "b1b4c3d31808c07d100b7e74f2f0d85ffef12348ad4b1be2e679e6baf9d9e6ea",
    "ccdproc/tests/run_profile.ipynb": "67e52cb306a9bc1ae20f2246f20902852f64473d996cd9e162525914a1ca95cd",
    "ccdproc/tests/run_with_file_number_limit.py": "baa23a496ebeb088266a12f80c0ed04aa52f917d2cedd77abf99208be538c410",
    "ccdproc/tests/test_bitfield.py": "db336ed38398ba4741844d7633d0dd21963eda12c3fcea353db7c80c2b6cbebf",
    "ccdproc/tests/test_ccdmask.py": "ca19b9320ac438aae53a1b97d4b06236ac72ec7823a747ea7a4c4319fb94e91c",
    "ccdproc/tests/test_ccdproc.py": "c69b58a147a4c2637c236dac1389cdd119dfeff4fbc1d693762a3893cb4d06cc",
    "ccdproc/tests/test_ccdproc_logging.py": "8c410f0b3ead5a61579cabb9dc0ddea77e4f6481d7d407d5007a7171360cf076",
    "ccdproc/tests/test_combine_open_files.py": "e57ee946754c7b22f1aa37f985c9d5553f12a79b96a4629742628f1ad3232c4c",
    "ccdproc/tests/test_combiner.py": "53ace6b13d7916da404596151f76588e9e7a88564615ab1ef32867a3ea54c149",
    "ccdproc/tests/test_cosmicray.py": "cfff0f3a1ddfaebaff7a650916764098215dafe86196ebbdea0d319ff55e5a48",
    "ccdproc/tests/test_gain.py": "7b9a60bc30d336e907ce0bcb83e11d0b6788f5744cf65e886e756fad3cb8b032",
    "ccdproc/tests/test_image_collection.py": "eb390a8e5c7f20738c9814cb58f1bfc46fc83f3dcf194e8eccccaa53b8ad0af9",
    "ccdproc/tests/test_keyword.py": "af663dcb5f49ec0915c6304aec60abbf07932c7041ca635b069dbbcd2633244a",
    "ccdproc/tests/test_memory_use.py": "3e19394dc693409ff37cadb1ddd9ae40169c0e5ba34a2d3bf9c3bd7637a31c42",
    "ccdproc/tests/test_rebin.py": "0fd07b3b92c85cd3704ea4b66c25af4dcee38d64a4c3999660ba7611a89baa53",
    "ccdproc/tests/test_wrapped_external_funcs.py": "2258f19e5f207b375dd31edbbe67ef1ebe6c9a2f8f5a15c10b9565ae36232e7f"
  }
}

The bundle

Recorded JSON and patches. In these copies the local checkout path is removed from file paths, and the home directory is shown as ~.