Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/dm 8213 #120

Merged
merged 3 commits into from Nov 14, 2016
Merged

Tickets/dm 8213 #120

merged 3 commits into from Nov 14, 2016

Conversation

r-owen
Copy link
Contributor

@r-owen r-owen commented Nov 14, 2016

No description provided.

Copy link
Contributor Author

@r-owen r-owen left a comment

Choose a reason for hiding this comment

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

This looks great. (I'd click "Approve" but since I created this pull request I can't).

///
/// Includes support for the INHERIT convention: if 'INHERIT = T' is in the header, the
/// PHU will be read as well, and nominated HDU will override any duplicated values.
PTR(daf::base::PropertyList) readMetadata(std::string const & fileName, int hdu=0, bool strip=false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems like a very logical set of new functions.

I'm a bit disappointed that we can't just return a PropertyList instead of a pointer to a property list. I assume the pointer is used to avoid copying the data (though I wonder if C++ really would copy in this situation, or if it could swap).

Please document all three functions independently, so they all show up as documented in the Doxygen. If you want to void repetition then I suppose you could fully document one version and have a one-liner for the others that points to the full docs of the one, but personally I'd just add the repetition.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand it, the //@{ at the top of the doc and the //@} below the last declaration of readMetadata group the declarations together, so they all share the same doc.

The pointer is used because that's what we had before and I didn't want to change it without thinking more carefully.

}

PTR(daf::base::PropertyList) readMetadata(fits::Fits & fitsfile, bool strip) {
PTR(daf::base::PropertyList) metadata(new lsst::daf::base::PropertyList);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there's less repetitive way way to do this (and similar code below) with auto? Would this work?:

auto readMetadata = std::make_shared<daf::base::PropertyList>();

This version returns a PropertyList instead of a PropertySet.
Deprecated afw::image::readMetadata (it's in the wrong namespace) and
converted it to use afw::fits::readMetadata.
@PaulPrice PaulPrice merged commit fbb3f97 into master Nov 14, 2016
@ktlim ktlim deleted the tickets/DM-8213 branch August 25, 2018 06:44
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.

None yet

2 participants