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

Improved API and Developer guide #220

Merged
merged 16 commits into from
Dec 22, 2023
Merged

Improved API and Developer guide #220

merged 16 commits into from
Dec 22, 2023

Conversation

Samuwhale
Copy link
Collaborator

@Samuwhale Samuwhale commented Dec 2, 2023

Developer guide is now a full section, as opposed to the tiny (and very outdated) page it used to be.

API reference has also been restructured to be easier to navigate.

Lots of changes and information added - so please give it a thorough review!

@Samuwhale Samuwhale linked an issue Dec 2, 2023 that may be closed by this pull request
@Samuwhale Samuwhale marked this pull request as ready for review December 4, 2023 08:35
Copy link
Member

@qubixes qubixes left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Wow, that is a lot. I'm honestly worried it's a little bit too much detail (and possibly duplication). While it might be nice for there to be a lot of information, I'm worried about long term maintainability if things are mentioned in more than one place. From reading the documentation, it looks like the documentation is ordered by module/package. I think it might be an idea to order it more by purpose, by which I mean for example "I want to create a new distribution", "I want to create a new privacy package implementation", "I want to understand how the different classes interact". I'm curious what your thoughts about this!

docs/source/api/metasyn.distribution.rst Outdated Show resolved Hide resolved
docs/source/api/metasyn.rst Outdated Show resolved Hide resolved
docs/source/conf.py Show resolved Hide resolved
docs/source/developer/GMF.rst Outdated Show resolved Hide resolved
docs/source/developer/GMF.rst Outdated Show resolved Hide resolved
docs/source/developer/overview.rst Outdated Show resolved Hide resolved
docs/source/index.rst Outdated Show resolved Hide resolved
docs/source/usage/cli.rst Outdated Show resolved Hide resolved
docs/source/usage/extensions.rst Outdated Show resolved Hide resolved
docs/source/usage/quick_start.rst Outdated Show resolved Hide resolved
Co-authored-by: qubixes <44498096+qubixes@users.noreply.github.com>
The dev overview and distribution pages now contain more essential and condensed information.
Copy link
Member

@qubixes qubixes left a comment

Choose a reason for hiding this comment

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

We're getting somewhere! I'm sorry there's another bunch of comments from my side, but that happens sometimes with these big changes!

docs/source/developer/distributions.rst Outdated Show resolved Hide resolved

For a detailed overview of classes, methods and attributes mentioned on this page, refer to the :doc:`/api/metasyn`. Clicking on object names will automatically take you to their API reference page.

Distribution subpackage
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this better suited for the automated API Reference? We can also write more documentation strings for the modules/packages themselves, if there is not enough context.

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 do like having it here. I think this page serves to provide a birds-eye overview of what's relevant to creating new distributions, it doesn't bloat the page up, and provides nice references to the API for who-ever wants to read more. Once the API is more fleshed out, maybe information can be moved over there, but until then I'd rather keep this.


Finally it contains the :func:`~metasyn.distribution.metadist` decorator, which is used to set the attributes of a distribution.

BaseDistribution class
Copy link
Member

Choose a reason for hiding this comment

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

I think I would turn it around between the class and the decorator. I would start with the decorator, since it is the one developers work with the most. Then we can explain that the decorator sets these attributes for the developer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That said, keeping redundancy and ease of maintaining in mind, I am tweaking the page a bit.

docs/source/developer/distributions.rst Outdated Show resolved Hide resolved
docs/source/developer/distributions.rst Show resolved Hide resolved
docs/source/developer/distributions.rst Outdated Show resolved Hide resolved
docs/source/developer/distributions.rst Show resolved Hide resolved

The :obj:`~metasyn.MetaVar` class contains functionality for:

- **Detecting variable types**: The :meth:`~metasyn.MetaVar.detect` method detects the variable class(es) of a series or dataframe. This method does not fit any distribution, but it does infer the correct types for the :obj:`~metasyn.MetaVar` and saves the ``Series`` for later fitting.
Copy link
Member

Choose a reason for hiding this comment

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

I think for most cases, the MetaVar is more of a passthrough class. (I haven't worked on it really for a really long time!), so I think we don't need to have this part about the methods here (it can stay in the API ref). One thing that may be nice is a small section on how to create a MetaFrame without data, what do you think?

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 have rephrased it a bit. I do like the information being here for now - as it helps provide a fuller context.

- **Converting to and from a dictionary**: The :meth:`~metasyn.MetaVar.to_dict` method creates a dictionary from the variable. The :meth:`~metasyn.MetaVar.from_dict` method restores a variable from a dictionary.


Subpackages
Copy link
Member

Choose a reason for hiding this comment

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

This can all go into the API as well.

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 have significantly shortened the subpackages and submodules sections. I like to keep them like this for now, and then soon once the API has been fully fleshed out, see how they can be condensed further.

docs/source/usage/cli.rst Outdated Show resolved Hide resolved
Co-authored-by: qubixes <44498096+qubixes@users.noreply.github.com>
@Samuwhale Samuwhale force-pushed the docs-dev-guide branch 2 times, most recently from 210bf30 to 753e355 Compare December 21, 2023 10:15
@Samuwhale
Copy link
Collaborator Author

I have further condensed and changed information based on comments. There's still some (technically) redundant information, but for now, it helps paint a clear picture for developers wanting to get started.

I aim to improve the docstrings + API next; once that has been done, I will reevaluate the content on the dev guide pages and further condense/remove it where necessary.

Copy link
Member

@qubixes qubixes left a comment

Choose a reason for hiding this comment

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

Thanks a lot for all the work! Let's merge it soon!

Co-authored-by: qubixes <44498096+qubixes@users.noreply.github.com>
@Samuwhale Samuwhale merged commit 1f908f1 into main Dec 22, 2023
6 checks passed
@Samuwhale Samuwhale mentioned this pull request Jan 8, 2024
4 tasks
@qubixes qubixes deleted the docs-dev-guide branch February 19, 2024 13:51
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.

Developer guide detailed overview (docs) is outdated
2 participants