Skip to content

Support fitsbolt 0.3.1 and cutana 0.4.0 - #21

Closed
gomezzz wants to merge 1 commit into
developfrom
fix/fitsbolt-0.3
Closed

gomezzz wants to merge 1 commit into
developfrom
fix/fitsbolt-0.3

Conversation

@gomezzz

@gomezzz gomezzz commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Relax the fitsbolt pin to >=0.3.1,<0.4 and require cutana>=0.4.0. fitsbolt 0.3.1 fixes the fits_extension=None validation crash that motivated the ==0.2.0 pin (f72b3db). cutana 0.4.0 requires fitsbolt>=0.3.1, so the old pin silently forced pip to fall back to cutana 0.3.1 (noticed in the Euclid EC GPU datalab image).
  • Keep old checkpoints working. Models saved with fitsbolt 0.2 store a fitsbolt_cfg that has no *_n_samples keys and keeps the midtones parameters as scalars. Under fitsbolt 0.3, prediction with such a model raised TypeError: '>' not supported between instances of 'int' and 'DotMap' for every normalisation method except ZSCALE. load_checkpoint now upgrades these configs in place (None = use all pixels, which matches the pre-0.3 behaviour).
  • Test fixes caused by the upgrade:
    • fitsbolt 0.3 resizes with OpenCV, so interpolation_order is now 0–4 (4 = INTER_AREA, which is identical to nearest neighbour when upscaling). The default (1, linear) is unchanged.
    • cutana 0.4's streaming orchestrator returns batches in completion order. test_cutana_vs_training_normalisation paired images by position and failed under parallel load (max abs diff = 254), so it now pairs them by source ID. The production path in prediction_process_cutana.py already maps results by metadata["source_id"] and is unaffected.

Validation

  • I saved a checkpoint in a fitsbolt 0.2.0 env and loaded it in a fitsbolt 0.3.1 env, then pushed an image through process_single_wrapper for all 6 normalisation methods. Before this change: 5/6 fail. After: 6/6 pass. This case is now covered by a unit test.
  • I measured how far training and prediction preprocessing drift apart (load_and_process_wrapper vs load_and_process_single_wrapper):
    • CONVERSION_ONLY: about 1 grey level mean difference with both fitsbolt 0.2.0 and 0.3.1.
    • ASINH: 0 with both versions.
    • Resize semantics for trained models are effectively unchanged.

Test plan

  • Full suite on fitsbolt 0.3.1 + cutana 0.4.0 (CPU torch, Python 3.11): 377 passed, 3× with -n 8 and 1× serially
  • Baseline on fitsbolt 0.2.0 + cutana 0.3.1: 376 passed (no regressions on the old pin)
  • ruff check / ruff format --check clean on all touched files
  • CI green
  • GPU smoke test: train, then predict with a pre-existing v1.3.x model

🤖 Generated with Claude Code

Relax the fitsbolt pin to >=0.3.1,<0.4 and require cutana>=0.4.0.
fitsbolt 0.3.1 fixes the fits_extension=None validation crash that
motivated the ==0.2.0 pin, and cutana 0.4.0 requires it, so the old
pin silently forced cutana back to 0.3.1.

- Upgrade fitsbolt<0.3 configs stored in checkpoints on load, so
  models saved with fitsbolt 0.2 keep working for prediction
- Adapt the interpolation-order test to fitsbolt's OpenCV resize
  (orders 0-4; order 4 = INTER_AREA)
- Match cutana cutouts by source ID in the normalisation consistency
  test, as cutana's streaming orchestrator yields batches unordered

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Overall Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py80100% 
data_io
   SessionIOHandler.py3264187%111, 128–129, 173–174, 184–185, 215–216, 282–283, 286, 326–328, 370, 388–390, 455, 530, 553, 567–568, 570–571, 573–575, 719–724, 738, 742–743, 747–749
   checkpoint_io.py1602584%68, 74, 76, 78, 95–109, 120, 122, 161, 182, 228, 308
   find_images_in_folder.py210100% 
   load_images.py912869%51–53, 58–60, 81, 93, 110, 140–147, 150, 156–157, 189, 248, 256, 277, 285, 292–294
   metadata_handler.py80890%70–71, 117, 122–123, 170–172
   save_config.py33391%92–94
datasets
   AnomalyDetectionDataset.py2483984%126–127, 356, 362–363, 365, 369, 371–372, 374, 395–396, 398, 404–405, 409, 422–423, 484–485, 491–496, 498–499, 503–506, 508–510, 512–514, 525
   BasicDataset.py52492%59, 61, 97, 103
   Label.py50100% 
   SSL_Dataset.py68396%136, 139, 209
   __init__.py00100% 
   data_utils.py56296%80, 199
datasets/augmentation
   randaugment.py921188%222, 225–226, 245, 328–330, 332–335
   randaugment_multispectral.py772370%77–79, 120–121, 134–135, 148–149, 166, 170, 174, 248, 253, 270–272, 274–277, 280–281
image_processing
   transforms.py57395%46–47, 76
models
   FixMatch.py2142986%108, 201–202, 217, 222, 254, 281–282, 285, 288–290, 293, 301, 306–307, 366, 404, 430–434, 495, 497–498, 502, 519–520
pipeline
   SessionTracker.py122398%127, 219–220
   session.py5418584%146–149, 399–402, 447, 460, 612, 669, 671–672, 680, 683, 694, 702, 732, 736, 740–741, 745, 750–751, 758, 762–763, 775, 785–786, 788, 792, 806–807, 809–811, 813, 816–817, 875–876, 878–881, 883–887, 893, 899, 904–908, 910, 918, 921–922, 938, 979–980, 986–987, 991–993, 995, 1020, 1046, 1080–1081, 1089, 1100, 1108, 1112, 1116, 1121, 1124, 1168, 1171
utils
   accuracy.py130100% 
   consistency_loss.py180100% 
   create_model_string.py40100% 
   cross_entropy_loss.py90100% 
   cutana_stream_utils.py70987%64–65, 88, 108, 118–122
   get_cosine_schedule_with_warmup.py11191%39
   get_default_cfg.py610100% 
   get_net_builder.py55787%81–82, 89, 92, 170–171, 175
   get_optimizer.py21290%54, 58
   print_cfg.py45491%89, 95, 117, 119
   set_log_level.py150100% 
   set_seeds.py13285%25–26
   validate_config.py1311192%180, 199, 214, 228, 244, 248, 264, 290, 379–381
TOTAL271734387% 

Tests Skipped Failures Errors Time
377 0 💤 0 ❌ 0 🔥 58.478s ⏱️

@gomezzz gomezzz closed this Oct 6, 2026
@gomezzz
gomezzz deleted the fix/fitsbolt-0.3 branch October 6, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant