Skip to content

Make compatible with casacore 3.8.2 - #18

Merged
aroffringa merged 4 commits into
mainfrom
casacore-3_8_2-compatibility
Oct 6, 2026
Merged

aroffringa merged 4 commits into
mainfrom
casacore-3_8_2-compatibility

Conversation

@aroffringa

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 08:40
@aroffringa aroffringa self-assigned this Oct 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The declared CMake minimum does not support C++20, and making the public storage-manager class final introduces an unrelated breaking API change.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Updates LofarStMan and its tests for casacore 3.8.2 compatibility.

Changes:

  • Replaces legacy casacore aliases with standard C++ types.
  • Modernizes virtual overrides and column accessors.
  • Raises the minimum CMake version.
File Description
CMakeLists.txt Updates the minimum CMake version.
include/​LofarStMan/​LofarStMan.h Modernizes storage-manager declarations and types.
include/​LofarStMan/​LofarColumn.h Updates column interfaces and overrides.
src/​LofarStMan.cc Applies compatible types throughout storage management.
src/​LofarColumn.cc Updates column implementations to standard types.
test/​tLofarStMan.cc Adapts functional tests to the updated APIs.
test/​tIOPerf.cc Updates I/O performance tests and string handling.
test/​tfix.cc Modernizes the column-fix utility test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakeLists.txt Outdated
Comment thread include/LofarStMan/LofarStMan.h
aroffringa and others added 3 commits October 6, 2026 10:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The compatibility changes align with the relevant casacore APIs without introducing unresolved correctness issues.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@tammojan

tammojan commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Some of the Ints referred to things that are by definition 32 bits on disk. Could you have a go at changing those to int32_t? This should be an easy task for copilot.

@aroffringa

Copy link
Copy Markdown
Contributor Author

Some of the Ints referred to things that are by definition 32 bits on disk. Could you have a go at changing those to int32_t? This should be an easy task for copilot.

This PR is just a compatibility fix. Feel free to try that yourself ;).

@aroffringa
aroffringa requested a review from gmloose October 6, 2026 12:15
@tammojan

tammojan commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Some of the Ints referred to things that are by definition 32 bits on disk. Could you have a go at changing those to int32_t? This should be an easy task for copilot.

This PR is just a compatibility fix. Feel free to try that yourself ;).

I do think that changing Int to int is a mistake and it should be int32_t explicitly, that's why this type exists. But LofarStMan not compiling is a bigger problem than a future incompatibilities on systems where int is not 32 bits. So I'll approve, leaving the int32 as a future problem.

@aroffringa

Copy link
Copy Markdown
Contributor Author

I do think that changing Int to int is a mistake and it should be int32_t explicitly, that's why this type exists. But LofarStMan not compiling is a bigger problem than a future incompatibilities on systems where int is not 32 bits. So I'll approve, leaving the int32 as a future problem.

Thanks! Some of this was also discussed in mail, but I think that replacing all ints by int32_t isn't what we want either. I agree that anything used for storage should have a fixed width, but we shouldn't want to have fixed size int32_ts in the API or be used in every loop, etc. --- that's not why the int32_t type exists, that's why int exists.

It's not that replacing Int by int suddenly makes this a problem, as they are equivalent. It's not harder to do a replace-all from int to int32_t than it is to replace all Int to int32_t, if we really did would have wanted that.

I had also asked Marcel to review, I'll await what he thinks before merging :).

@gmloose gmloose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two minor issues that don't stand in the way, I think.

Comment thread test/tLofarStMan.cc
Comment on lines +421 to +443
ArrayColumn<Complex> dataCol(tab, "DATA");
ArrayColumn<float> weightCol(tab, "WEIGHT");
ArrayColumn<float> wspecCol(tab, "WEIGHT_SPECTRUM");
ArrayColumn<float> sigmaCol(tab, "SIGMA");
ArrayColumn<double> uvwCol(tab, "UVW");
ArrayColumn<bool> flagCol(tab, "FLAG");
ArrayColumn<bool> flagcatCol(tab, "FLAG_CATEGORY");
ScalarColumn<double> timeCol(tab, "TIME");
ScalarColumn<double> centCol(tab, "TIME_CENTROID");
ScalarColumn<double> intvCol(tab, "INTERVAL");
ScalarColumn<double> expoCol(tab, "EXPOSURE");
ScalarColumn<int> ant1Col(tab, "ANTENNA1");
ScalarColumn<int> ant2Col(tab, "ANTENNA2");
ScalarColumn<int> feed1Col(tab, "FEED1");
ScalarColumn<int> feed2Col(tab, "FEED2");
ScalarColumn<int> ddidCol(tab, "DATA_DESC_ID");
ScalarColumn<int> pridCol(tab, "PROCESSOR_ID");
ScalarColumn<int> fldidCol(tab, "FIELD_ID");
ScalarColumn<int> arridCol(tab, "ARRAY_ID");
ScalarColumn<int> obsidCol(tab, "OBSERVATION_ID");
ScalarColumn<int> stidCol(tab, "STATE_ID");
ScalarColumn<int> scnrCol(tab, "SCAN_NUMBER");
ScalarColumn<bool> flagrowCol(tab, "FLAG_ROW");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, did that class type change name? Or did you fix a lingering bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the Column classes that start with "RO" have been deprecated quite long ago, and are aliased to their non-RO counter parts. When they were deprecated, the C++ deprecated annotation probably didn't exist yet ;) . But we could now also make the aliases [[deprecated()]].

Comment thread CMakeLists.txt

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3")
add_compile_options(
-O3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think it's a bad idea to hard-code optimization levels in a CMakeLists.txt file, but since this is just reformatting ..., I'll ignore it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we in general want is that the default is -O3, even when not explicitly specifying it is a release. If that can be done otherwise I'm fine with that, though the hardcoded -O3 is I think in almost all our software ;).

If you want we can discuss further, for now I'll merge as indeed the -O3 behaviour itself didn't change.

Thanks!

@aroffringa
aroffringa merged commit 74362b8 into main Oct 6, 2026
3 checks passed
@aroffringa
aroffringa deleted the casacore-3_8_2-compatibility branch October 6, 2026 12:38
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.

4 participants