Skip to content

Commit

Permalink
Merge pull request #700 from lsst/tickets/DM-34195
Browse files Browse the repository at this point in the history
DM-34195: Remove deprecated shared_ptr interfaces
  • Loading branch information
mwittgen authored Jul 12, 2023
2 parents e482522 + 4c7d288 commit 8929684
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 181 deletions.
10 changes: 0 additions & 10 deletions include/lsst/afw/fits.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,6 @@ class Fits {
image::ImageBase<T> const& image, ImageWriteOptions const& options,
daf::base::PropertySet const * header = nullptr,
image::Mask<image::MaskPixel> const * mask = nullptr);
template <typename T>
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeImage(
image::ImageBase<T> const& image, ImageWriteOptions const& options,
std::shared_ptr<daf::base::PropertySet const> header = nullptr,
std::shared_ptr<image::Mask<image::MaskPixel> const> mask = nullptr);
//@}

/// Return the number of dimensions in the current HDU.
Expand Down Expand Up @@ -700,10 +694,6 @@ class Fits {
std::shared_ptr<daf::base::PropertyList> combineMetadata(
daf::base::PropertyList const & first,
daf::base::PropertyList const & second);
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
std::shared_ptr<daf::base::PropertyList> combineMetadata(
std::shared_ptr<daf::base::PropertyList const> first,
std::shared_ptr<daf::base::PropertyList const> second);
//@}

/** Read FITS header
Expand Down
7 changes: 0 additions & 7 deletions include/lsst/afw/fitsCompression.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,6 @@ class ImageScalingOptions {
return determine(arrays.first, arrays.second);
}

template <typename T>
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
ImageScale determine(image::ImageBase<T> const& image,
std::shared_ptr<image::Mask<image::MaskPixel> const> mask) const {
return determine(image, mask.get());
}

template <typename T, int N>
ImageScale determine(ndarray::Array<T const, N, N> const& image,
ndarray::Array<bool, N, N> const& mask) const;
Expand Down
32 changes: 0 additions & 32 deletions include/lsst/afw/image/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,6 @@ class Image : public ImageBase<PixelT> {
void writeFits(std::string const& fileName,
daf::base::PropertySet const * metadata = nullptr,
std::string const& mode = "w") const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(std::string const& fileName,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode = "w") const;
//@}

//@{
Expand All @@ -253,10 +249,6 @@ class Image : public ImageBase<PixelT> {
void writeFits(fits::MemFileManager& manager,
daf::base::PropertySet const * metadata = nullptr,
std::string const& mode = "w") const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::MemFileManager& manager,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode = "w") const;
//@}

//@{
Expand All @@ -267,8 +259,6 @@ class Image : public ImageBase<PixelT> {
* @param[in] metadata Additional values to write to the header (may be null).
*/
void writeFits(fits::Fits& fitsfile, daf::base::PropertySet const * metadata = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::Fits& fitsfile, std::shared_ptr<daf::base::PropertySet const> metadata) const;
//@}

//@{
Expand All @@ -285,11 +275,6 @@ class Image : public ImageBase<PixelT> {
std::string const& mode = "w",
daf::base::PropertySet const * header = nullptr,
Mask<MaskPixel> const * mask = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(std::string const& filename, fits::ImageWriteOptions const& options,
std::string const& mode,
std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<Mask<MaskPixel> const> mask = nullptr) const;
//@}

//@{
Expand All @@ -306,11 +291,6 @@ class Image : public ImageBase<PixelT> {
std::string const& mode = "w",
daf::base::PropertySet const * header = nullptr,
Mask<MaskPixel> const *mask = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::MemFileManager& manager, fits::ImageWriteOptions const& options,
std::string const& mode,
std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<Mask<MaskPixel> const> mask = nullptr) const;
//@}

//@{
Expand All @@ -325,10 +305,6 @@ class Image : public ImageBase<PixelT> {
void writeFits(fits::Fits& fitsfile, fits::ImageWriteOptions const& options,
daf::base::PropertySet const * header = nullptr,
Mask<MaskPixel> const * mask = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::Fits& fitsfile, fits::ImageWriteOptions const& options,
std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<Mask<MaskPixel> const> mask = nullptr) const;
//@}

/**
Expand Down Expand Up @@ -511,10 +487,6 @@ class DecoratedImage {
void writeFits(std::string const& fileName,
daf::base::PropertySet const * metadata = nullptr,
std::string const& mode = "w") const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(std::string const& fileName,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode = "w") const;
//@}

//@{
Expand All @@ -529,10 +501,6 @@ class DecoratedImage {
void writeFits(std::string const& fileName, fits::ImageWriteOptions const& options,
daf::base::PropertySet const * metadata = nullptr,
std::string const& mode = "w") const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(std::string const& fileName, fits::ImageWriteOptions const& options,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode = "w") const;
//@}

/// Return a shared_ptr to the DecoratedImage's Image
Expand Down
22 changes: 0 additions & 22 deletions include/lsst/afw/image/Mask.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,6 @@ class Mask : public ImageBase<MaskPixelT> {
void writeFits(std::string const& fileName,
daf::base::PropertySet const * metadata = nullptr,
std::string const& mode = "w") const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(std::string const& fileName,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode = "w") const;
//@}

//@{
Expand All @@ -371,10 +367,6 @@ class Mask : public ImageBase<MaskPixelT> {
void writeFits(fits::MemFileManager& manager,
daf::base::PropertySet const * metadata = nullptr,
std::string const& mode = "w") const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::MemFileManager& manager,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode = "w") const;
//@}

//@{
Expand All @@ -385,9 +377,6 @@ class Mask : public ImageBase<MaskPixelT> {
* @param[in] metadata Additional values to write to the header (may be null).
*/
void writeFits(fits::Fits& fitsfile, daf::base::PropertySet const * metadata = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::Fits& fitsfile,
std::shared_ptr<daf::base::PropertySet const> metadata) const;
//@}

//@{
Expand All @@ -402,10 +391,6 @@ class Mask : public ImageBase<MaskPixelT> {
void writeFits(std::string const& filename, fits::ImageWriteOptions const& options,
std::string const& mode = "w",
daf::base::PropertySet const * header = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(std::string const& filename, fits::ImageWriteOptions const& options,
std::string const& mode,
std::shared_ptr<daf::base::PropertySet const> header) const;
//@}

//@{
Expand All @@ -420,10 +405,6 @@ class Mask : public ImageBase<MaskPixelT> {
void writeFits(fits::MemFileManager& manager, fits::ImageWriteOptions const& options,
std::string const& mode = "w",
daf::base::PropertySet const * header = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::MemFileManager& manager, fits::ImageWriteOptions const& options,
std::string const& mode,
std::shared_ptr<daf::base::PropertySet const> header) const;
//@}

//@{
Expand All @@ -436,9 +417,6 @@ class Mask : public ImageBase<MaskPixelT> {
*/
void writeFits(fits::Fits& fitsfile, fits::ImageWriteOptions const& options,
daf::base::PropertySet const * header = nullptr) const;
[[deprecated("Replaced by a non-shared_ptr overload. Will be removed after v25.")]]
void writeFits(fits::Fits& fitsfile, fits::ImageWriteOptions const& options,
std::shared_ptr<daf::base::PropertySet const> header) const;
//@}

/**
Expand Down
21 changes: 0 additions & 21 deletions src/fits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1409,12 +1409,6 @@ void Fits::writeImage(image::ImageBase<T> const &image, ImageWriteOptions const
}
}

template <typename T>
void Fits::writeImage(image::ImageBase<T> const &image, ImageWriteOptions const &options,
std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<image::Mask<image::MaskPixel> const> mask) {
writeImage(image, options, header.get(), mask.get());
}

namespace {

Expand Down Expand Up @@ -1676,18 +1670,6 @@ std::shared_ptr<daf::base::PropertyList> combineMetadata(
return combined;
}

std::shared_ptr<daf::base::PropertyList> combineMetadata(
std::shared_ptr<daf::base::PropertyList const> first,
std::shared_ptr<daf::base::PropertyList const> second) {
if (!first) {
throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, "First argument may not be null/None.");
}
if (!second) {
throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, "Second argument may not be null/None.");
}
return combineMetadata(*first, *second);
}

using dafPlistPtr = std::shared_ptr<daf::base::PropertyList>;

namespace detail {
Expand Down Expand Up @@ -1879,9 +1861,6 @@ std::shared_ptr<daf::base::PropertySet> ImageWriteOptions::validate(daf::base::P
template void Fits::writeImage(image::ImageBase<T> const &, ImageWriteOptions const &, \
daf::base::PropertySet const *, \
image::Mask<image::MaskPixel> const *); \
template void Fits::writeImage(image::ImageBase<T> const &, ImageWriteOptions const &, \
std::shared_ptr<daf::base::PropertySet const>, \
std::shared_ptr<image::Mask<image::MaskPixel> const>); \
template void Fits::readImageImpl(int, T *, long *, long *, long *); \
template bool Fits::checkImageType<T>(); \
template int getBitPix<T>();
Expand Down
13 changes: 0 additions & 13 deletions src/image/DecoratedImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ void DecoratedImage<PixelT>::writeFits(std::string const& fileName,
writeFits(fileName, options, metadata, mode);
}

template <typename PixelT>
void DecoratedImage<PixelT>::writeFits(std::string const& fileName,
std::shared_ptr<daf::base::PropertySet const> metadata,
std::string const& mode) const {
writeFits(fileName, metadata.get(), mode);
}

template <typename PixelT>
void DecoratedImage<PixelT>::writeFits(std::string const& fileName, fits::ImageWriteOptions const& options,
daf::base::PropertySet const * metadata_i,
Expand All @@ -122,12 +115,6 @@ void DecoratedImage<PixelT>::writeFits(std::string const& fileName, fits::ImageW
getImage()->writeFits(fileName, options, mode, metadata.get());
}

template <typename PixelT>
void DecoratedImage<PixelT>::writeFits(std::string const& fileName, fits::ImageWriteOptions const& options,
std::shared_ptr<daf::base::PropertySet const> metadata_i,
std::string const& mode) const {
writeFits(fileName, options, metadata_i.get(), mode);
}

//
// Explicit instantiations
Expand Down
40 changes: 0 additions & 40 deletions src/image/Image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,6 @@ void Image<PixelT>::writeFits(std::string const& fileName,
writeFits(fitsfile, metadata_i);
}

template <typename PixelT>
void Image<PixelT>::writeFits(std::string const& fileName,
std::shared_ptr<daf::base::PropertySet const> metadata_i,
std::string const& mode) const {
writeFits(fileName, metadata_i.get(), mode);
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::MemFileManager& manager,
daf::base::PropertySet const * metadata_i,
Expand All @@ -408,25 +401,13 @@ void Image<PixelT>::writeFits(fits::MemFileManager& manager,
writeFits(fitsfile, metadata_i);
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::MemFileManager& manager,
std::shared_ptr<daf::base::PropertySet const> metadata_i,
std::string const& mode) const {
writeFits(manager, metadata_i.get(), mode);
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::Fits& fitsfile,
daf::base::PropertySet const * metadata) const {
fitsfile.writeImage(*this, fits::ImageWriteOptions(*this), metadata);
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::Fits& fitsfile,
std::shared_ptr<daf::base::PropertySet const> metadata) const {
writeFits(fitsfile, metadata.get());
}

template <typename PixelT>
void Image<PixelT>::writeFits(std::string const& filename, fits::ImageWriteOptions const& options,
std::string const& mode, daf::base::PropertySet const * header,
Expand All @@ -435,13 +416,6 @@ void Image<PixelT>::writeFits(std::string const& filename, fits::ImageWriteOptio
writeFits(fitsfile, options, header, mask);
}

template <typename PixelT>
void Image<PixelT>::writeFits(std::string const& filename, fits::ImageWriteOptions const& options,
std::string const& mode, std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<Mask<MaskPixel> const> mask) const {
writeFits(filename, options, mode, header.get(), mask.get());
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::MemFileManager& manager, fits::ImageWriteOptions const& options,
std::string const& mode, daf::base::PropertySet const * header,
Expand All @@ -450,27 +424,13 @@ void Image<PixelT>::writeFits(fits::MemFileManager& manager, fits::ImageWriteOpt
writeFits(fitsfile, options, header, mask);
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::MemFileManager& manager, fits::ImageWriteOptions const& options,
std::string const& mode, std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<Mask<MaskPixel> const> mask) const {
writeFits(manager, options, mode, header.get(), mask.get());
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::Fits& fitsfile, fits::ImageWriteOptions const& options,
daf::base::PropertySet const * header,
Mask<MaskPixel> const * mask) const {
fitsfile.writeImage(*this, options, header, mask);
}

template <typename PixelT>
void Image<PixelT>::writeFits(fits::Fits& fitsfile, fits::ImageWriteOptions const& options,
std::shared_ptr<daf::base::PropertySet const> header,
std::shared_ptr<Mask<MaskPixel> const> mask) const {
writeFits(fitsfile, options, header.get(), mask.get());
}

#endif // !DOXYGEN

template <typename PixelT>
Expand Down
Loading

0 comments on commit 8929684

Please sign in to comment.