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

DM-43906: Make gauss2d_fit more dev guide compliant #13

Merged
merged 21 commits into from
Jul 16, 2024
Merged

Conversation

taranu
Copy link
Collaborator

@taranu taranu commented Jun 18, 2024

Like for gauss2d, this is in prep for adding it to lsst_distrib. Although it will be added as a third party package to start, the dev guidelines are worth following anyway.

.def("__getitem__", &Data::at)
.def("__len__", &Data::size)
// .def("__repr__", [](const Data &self) { return self.repr(true);
// })
Copy link
Member

Choose a reason for hiding this comment

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

Did you intend to delete or uncomment this?

@@ -0,0 +1,58 @@
.. py:currentmodule:: lsst.gauss2d.fit
Copy link
Member

Choose a reason for hiding this comment

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

I hadn't realized the Python package was going to be lsst.gauss2d.fit rather than lsst.gauss2dfit. Does this actually work with lsst.gauss2d being provided by another git/eups package? In other cases where we have a Python package split across multiple git/eups packages, we have to put them at the same level, since there can only be one (e.g.) lsst/gauss2d/__init__.py (either the pkgutils one that splits sibling packages, or a regular one).

There's some chance that this could work if PYTHONPATH has the two package directories in one order, and not if they are in the other order.


``lsst.gauss2d.fit`` has Python bindings for classes using numpy-based single
and double precision arrays. Support for GSL arrays is forthcoming with
`DM-38617 <https://jira.lsstcorp.org/browse/DM-38617>`_.
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave TODO entries like this out of the docs. It's too easy for them to become stale.

@@ -36,7 +36,8 @@

PYBIND11_MODULE(_gauss2d_fit, m) {
m.doc() = "Gauss2DFit Python bindings";
py::module::import("gauss2d");
// Is this necessary? Apparently not
// py::module::import("lsst.gauss2d");
Copy link
Member

Choose a reason for hiding this comment

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

The impact of having this can be subtle: if you have any signatures in this package that reference types defined in lsst.gauss2d, you'll get better docstrings and conversion behavior will be more likely to be correct if you have this import in place.

@@ -0,0 +1,10 @@
# Change Log

All notable changes to this project will be documented in this file.
Copy link
Member

Choose a reason for hiding this comment

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

If you are the only developer this approach is probably fine but if there are going to be other people working on it consider using towncrier as is done in middleware.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about it but is it not mainly Python-oriented?

Copy link
Member

Choose a reason for hiding this comment

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

It's nothing to do with python other than you can configure it in a pyproject.toml file. You run the towncrier command to combine the fragments into a single file.

Copy link
Collaborator Author

@taranu taranu Jul 9, 2024

Choose a reason for hiding this comment

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

Hmm, ok. I'll consider it for a future ticket. Are there instructions/best practices for the middleware approach beyond the notes on DM-30291 and the doc/changes dir? I think I've only gone through the process of add a news item once.

taranu and others added 5 commits July 9, 2024 14:28
This restructuring makes it easier to build and install
standalone with pip, as hacky as it is.
@taranu taranu force-pushed the tickets/DM-43906 branch from 4346744 to 9f98a4e Compare July 9, 2024 21:37
@taranu taranu force-pushed the tickets/DM-43906 branch from e624a8e to 1ee8493 Compare July 16, 2024 01:38
@taranu taranu merged commit e771251 into main Jul 16, 2024
2 checks passed
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.

3 participants