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

Sphinx documentation #94

Merged
merged 13 commits into from
Dec 4, 2024
Merged

Sphinx documentation #94

merged 13 commits into from
Dec 4, 2024

Conversation

FedericoBerlfein
Copy link
Collaborator

Adding Sphinx documentation files. This is the first version, still need to make a few checks before merging.

@FedericoBerlfein FedericoBerlfein self-assigned this Nov 6, 2024
@FedericoBerlfein FedericoBerlfein linked an issue Nov 6, 2024 that may be closed by this pull request
@FedericoBerlfein
Copy link
Collaborator Author

FedericoBerlfein commented Nov 8, 2024

Latest changes could use an initial review. Some known issues:

  • Some of the documentation style is not consistent with each other (example: how function arguments are written in docstring), causing differences between documentation of functions.
  • Could not create the HTML file for the instrument_params file. I think this has something to do with the fact that the code contains no functions/classes, so it is being skipped by Sphinx.

Despite this, I think I could benefit from some initial feedback on the structure of the documentation, or anything that could be missing

Copy link
Collaborator

@aguinot aguinot left a comment

Choose a reason for hiding this comment

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

It looks really good, nice work!
As you will some of my comment are not directed to you but more on things that we should discuss as group, so don't worry if you don't have the answer.
I really like the display of the functions with the docstrings and the link to the code source !! 👍

Some general minor comments (maybe for later):

  • Is it possible to change the theme? I found this a bit "sad" 😅

  • It looks like the name The Euclid-like ImSim Module too long and module appears on a separate line. Maybe changing the theme would solve the problem but at the moment it looks a bit confusing.

Screenshot 2024-11-08 at 14 39 45
  • in the Module Index only euclidlike_imsim appears and no euclidlike

  • Probably related to the comment above, when you search for something it looks through euclidlike_imsim and the scripts but not the euclidlike module. I tied with words: psf, bandpass

  • That might also be related to the theme. Only some of the functions appears but not all of them. Like for example some of the WCS functions are not listed.

docs/_build/html/_sources/examples.rst.txt Outdated Show resolved Hide resolved
docs/_build/html/_sources/examples.rst.txt Outdated Show resolved Hide resolved
docs/_build/html/_sources/examples.rst.txt Outdated Show resolved Hide resolved
docs/_build/html/_sources/examples.rst.txt Show resolved Hide resolved
docs/_build/html/_sources/overview.rst.txt Outdated Show resolved Hide resolved
CHANGELOG.rst Outdated
@@ -0,0 +1,3 @@
Changes from v0.0.0 to v0.0.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a comment to you specifically.
We should discuss this at some point. But I think it would be more appropriate to use v0.1.0 or even v1.0.0.
We should chat about that as a group.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change 0.9.0

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also not a comment for you.
We should review this page in the group.

import euclidlike_imsim

project = 'GalSim-Euclid-Like'
copyright = '2024, Rachel Mandelbaum, Axel Guinot, Federico Berlfein, Andy Park, Xiangchong Li, Michael Troxel, Tianqing Zhang'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should, somehow, include a reference to Euclid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rachel will ask once documentation is live.

docs/conf.py Outdated
project = 'GalSim-Euclid-Like'
copyright = '2024, Rachel Mandelbaum, Axel Guinot, Federico Berlfein, Andy Park, Xiangchong Li, Michael Troxel, Tianqing Zhang'
author = 'Rachel Mandelbaum, Axel Guinot, Federico Berlfein, Andy Park, Xiangchong Li, Michael Troxel, Tianqing Zhang'
release = '0.0.1'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be to have a VERSION file and get the value from this file?
I am just thinking that would avoid having to change the version number in multiple places to avoid confusion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This would be cleaner yes. In GalSim the version lives inside the galsim folder, in our case we have euclidlike and euclidlike_imsim. Do we want the version to then live in the GalSim-Euclid-Like home directory then? Or also live in euclidlike.

Copy link
Collaborator

@aguinot aguinot Nov 9, 2024

Choose a reason for hiding this comment

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

Having both in the same place makes things a little more tricky but I think I would use one versioning for both and probably include it in GalSim-Euclid-Like. But I am open to other suggestions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make VERSION file.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment would apply to the readme.
Should we add a section like contributing? To make it clear that the code is fully public and not driven by Euclid and everyone is free to propose/implement new things?

@FedericoBerlfein
Copy link
Collaborator Author

FedericoBerlfein commented Nov 14, 2024

Further updates to address some comments, mainly:

  • Updated theme: same as that used in GalSim
  • Added version to euclidlike module. This also included a small addition to euclidlike __init__.py file.
  • Homogenized docstrings across functions in euclidlike. Some functions used "Args", others "Parameters". Spacing in some of them was also not consistent. Added Returns to Bandpass docstring.
  • Fixed broken links. This involved adding a new python file called gh-link.py to docs. This allows to easily link files from anywhere in the repo.
  • Added autosection label, this allows us to reference rst files from their header.

Potential issues and changes:

  • The previous "Installation Instructions" link in the main page's README no longer directs you anywhere. Previously it directed you to the INSTALL.rst file in the github repo. However, in the github pages, this would direct you to the github repo when clicked, rather than to the installation instructions html page. So for now the README in the github repo does not link to the installation file, it just says which file it is. In the github pages, it should link it to the appropiate html page.
  • For now the version is only under the euclidlike module. I tried having a single version python file under the root of the repo, but was getting an error when trying to access it from each module (euclidlike or euclidlike_imsim). So for now I only have it in euclidlike. Need to discuss this with group. In addition, pyproject.toml can't read the version directly from the python file, so it needs to be inputed manually for now. Could not find a clean solution to this issue.

@FedericoBerlfein
Copy link
Collaborator Author

FedericoBerlfein commented Nov 27, 2024

Made last couple of changes based on last weeks conversation. Mainly:

  • Changed version number to 0.9.0
  • Made VERSION txt file in repo root.
  • Added _version.py file to euclidlike_imsim
  • Added basic installation instructions in README.rst
  • Changed "classes and functions" section to "API" in euclidlike and euclidlike_imsim

I think this PR is ready for a final review and potential merge.

Copy link
Member

@rmandelb rmandelb left a comment

Choose a reason for hiding this comment

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

Just two small issues I noted in the documentation of the examples. I'm hitting "approve" because you might be able to fix it easily and then you can go ahead and merge.


:gh-link:`end_to_end_demo.py <examples/end_to_end_demo.py>`

This first demo is the euclidlike-equivalent of _`demo 13 <https://github.com/GalSim-developers/GalSim/blob/main/examples/demo13.py>`_ in ``GalSim``. This demo uses the Euclid-like PSF, WCS, and background noise to produce a realistic scene of galaxies and stars as observed from a Euclid-like Telescope.
Copy link
Member

Choose a reason for hiding this comment

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

Something is going wrong with this line, if you look at the html it produces on your branch, but I'm not sure how to fix it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed.


This first demo is the euclidlike-equivalent of _`demo 13 <https://github.com/GalSim-developers/GalSim/blob/main/examples/demo13.py>`_ in ``GalSim``. This demo uses the Euclid-like PSF, WCS, and background noise to produce a realistic scene of galaxies and stars as observed from a Euclid-like Telescope.

** Features introduced in the Python file**:
Copy link
Member

Choose a reason for hiding this comment

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

These asterisks are not doing what was intended (if you look at the html it produces)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed.

@rmandelb rmandelb merged commit 373eb17 into main Dec 4, 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.

Make documentation
3 participants