Skip to content

DM-52986: Add wrapper for SplineMap#70

Merged
cmsaunders merged 1 commit into
mainfrom
tickets/DM-52986
Dec 1, 2025
Merged

DM-52986: Add wrapper for SplineMap#70
cmsaunders merged 1 commit into
mainfrom
tickets/DM-52986

Conversation

@cmsaunders

Copy link
Copy Markdown
Contributor

No description provided.

@mwittgen mwittgen self-requested a review November 25, 2025 18:51
Comment thread include/astshim/SplineMap.h Outdated
*
* You should have received a copy of the LSST License Statement and
* the GNU General Public License along with this program. If not,
* see <https://www.lsstcorp.org/LegalNotices/>.

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.

The license banner is outdated

Comment thread src/SplineMap.cc
* You should have received a copy of the LSST License Statement and
* the GNU General Public License along with this program. If not,
* see <https://www.lsstcorp.org/LegalNotices/>.
*/

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.

outdated banner

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 fixed these two licenses, plus the python/astshim/splineMap.cc one, but it looks like almost all the others in the repo are wrong too. I guess that can be another ticket.

Comment thread include/astshim/SplineMap.h Outdated
: Mapping(reinterpret_cast<AstMapping *>(
_makeRawSplineMap(kx, ky, nx, ny, tx, ty, cu, cv, options))) {}

virtual ~SplineMap() {}

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.

Suggested change
virtual ~SplineMap() {}
~SplineMap() override = default;

Comment thread include/astshim/SplineMap.h Outdated


protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {

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.

virtual is redundant as the function is declared override

Suggested change
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {

Comment thread include/astshim/SplineMap.h Outdated
}

/// Construct a SplineMap from an raw AST pointer
SplineMap(AstSplineMap *map);

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.

Suggested change
SplineMap(AstSplineMap *map);
explicit SplineMap(AstSplineMap *map);

Comment thread include/astshim/SplineMap.h Outdated
#ifndef ASTSHIM_SPLINEMAP_H
#define ASTSHIM_SPLINEMAP_H

#include <algorithm>

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.

Nothing from algorithm is used in this header

@@ -0,0 +1,51 @@
/*

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.

I think this is the newer banner that should be used in the other new files as well.

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.

Comment thread src/SplineMap.cc Outdated
std::vector<double> const &ty, std::vector<double> const &cu, std::vector<double> const &cv,
std::string const &options) const {

const int nTx = tx.size();

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.

These do a narrowing cast.
size() returns size_t (unsigned 64 bit)
int is 32 bit (signed)
Likely OK as the vectors are not big.

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.

To be safe, I changed these to size_t, added a check that kx, ky, nx, and ny are not negative, and convert the kx + nx, nx * ny, etc. terms to size_t to prevent a compiler warning.

@mwittgen mwittgen 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.

Some minor comments.
Check license banners.

@cmsaunders cmsaunders merged commit f5dcc67 into main Dec 1, 2025
4 checks passed
@cmsaunders cmsaunders deleted the tickets/DM-52986 branch December 1, 2025 16:39
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.

2 participants