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

New docs #304

Merged
merged 9 commits into from
Oct 11, 2024
Merged

New docs #304

merged 9 commits into from
Oct 11, 2024

Conversation

manulera
Copy link
Collaborator

@manulera manulera commented Oct 9, 2024

Hello @BjornFJohansson @hiyama341 @dgruano @JeffXiePL

I have made some changes to the documentation that I think can make it a bit more engaging and easier to maintain.

Because the action is set to deploy from any branch, it has actually updated the docs to that, but as soon as someone pushes again, it will be overwritten, so you can check it in this netlify link: https://keen-jalebi-634077.netlify.app/

The main changes I have made:

  • Separate it into several sections, so that it's not a single long page with the module documentation (that's still there, but it's now just one of the sections).

  • I have added a script that is run when the docs are created in a github action, that converts the notebooks to markdown files, so they are included in the documentation as well.

    • That allows to search for the text in the notebooks, which is great to find solutions quickly.
    • For now, I have included two of them (one for getting started, one for examples), but I will add all of them if you think it's a good idea. I will also document how to add a notebook so that it's included in the documentation.
  • I have added a custom css file that is used to style the notebooks and make the output cells that are too long scrollable, so that it's easier to read.

  • Some of the content that goes into the docs pages is directly taken from the README.md file, so there is no need to repeat the docs in two places. I think this is so much better for maintenance. It's very simple with sphinx, you can check the file installation.rst and see that it's really simple to do so:

    .. include:: ../README.md
    :parser: myst_parser.sphinx_
    :start-after: ## Installation 📦
    :end-before: ## Contributing and feedback 🛠️

    In the long term, we should use comments instead to mark the start and end of what goes to the docs, but for the example, I just did it like this.

Let me know what you think. If you agree, I will finish up the changes and add the documentation of how to add notebooks to the docs.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.68%. Comparing base (fd8577c) to head (72c13aa).
Report is 5 commits behind head on dev_bjorn.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##           dev_bjorn     #304      +/-   ##
=============================================
+ Coverage      93.60%   93.68%   +0.08%     
=============================================
  Files             40       40              
  Lines           3922     3960      +38     
  Branches         588      604      +16     
=============================================
+ Hits            3671     3710      +39     
+ Misses           199      198       -1     
  Partials          52       52              
Files with missing lines Coverage Δ
src/pydna/crispr.py 87.23% <ø> (ø)

... and 2 files with indirect coverage changes

@BjornFJohansson
Copy link
Collaborator

I looked at the docs in the link and I think they look good. Some of the symbols do not work, like ☢️ on the first page. I think it needs an attractive image on the first page as well.

All the pages under "module content" seem the same? Should each module have its own page?

@manulera
Copy link
Collaborator Author

manulera commented Oct 10, 2024

Some of the symbols do not work, like ☢️ on the first page

Yes, this is because they are using the :emoji_name: syntax, which is not rendered in rst, they simply have to be replaced by the actual emoji, but I did not want to edit the README in this branch, since the other branches do.

needs an attractive image

What would you put?

All the pages under "module content" seem the same?

What do you mean? Now "module content" roughly corresponds to what the previous documentation was ( the autogenerated docs) is there something repeated?

@BjornFJohansson
Copy link
Collaborator

image

It seems like every page under the links in the gray area is a a different part of the same page.

In the Biopython docs it seems like
there is a file for each module.

The way it works in Pydna is perhaps due to old sphinx settings?

@manulera
Copy link
Collaborator Author

Yes, they are all in the same page as before. This is defined in module_contents.rst, we could make it so that every submodule is in a different page if you think it's better.

@manulera
Copy link
Collaborator Author

Anyway, let me know about the sub-pages for the modules, and if you agree with the overall idea. If so, I will add the rest of the notebooks and document how the docs generation works.

@BjornFJohansson
Copy link
Collaborator

BjornFJohansson commented Oct 10, 2024

I do agree with the overall idea. I think it would be better wit ha page for each module as we hope to expand the docstrings for most modules. It is not urgent imho.

@manulera
Copy link
Collaborator Author

Ok, I think it's looking good by now, and I incorporated what you suggested. You can have a look at how it looks in the same URL: https://keen-jalebi-634077.netlify.app/

I have documented how to work on the docs, and referenced it in the readme, so you can easily contribute:

https://github.com/BjornFJohansson/pydna/blob/fa07e0eee05188e5f535a33d902e78326fea4be7/docs/README.md

@dgruano
Copy link
Contributor

dgruano commented Oct 11, 2024

Now that we are at it and related to #259 : the Cas objects describe the structure of the sgRNA in the docstring. This causes some artifacts in the documentation page. I attach images of how it looks in the editor vs in the docs:

image
image

Any idea on how to solve/workaround this?

@dgruano
Copy link
Contributor

dgruano commented Oct 11, 2024

Okay, quick Google search explains how to create code blocks within Sphinx: just adding double colons before the text "::" (unless you can suggest something else).

We can take care of this with @JeffXiePL when we push the changes on the CRISPR module and its docs.

@manulera
Copy link
Collaborator Author

Hi @dgruano good catch! Thanks for checking. I fix it by adding a codeblock and with indentation, see:

72c13aa

@manulera
Copy link
Collaborator Author

Ok, I will merge this then, and we can always improve further.

@manulera manulera merged commit 768c6fa into dev_bjorn Oct 11, 2024
34 checks passed
@manulera manulera deleted the new_docs branch October 11, 2024 14:49
manulera added a commit that referenced this pull request Oct 24, 2024
* added new translation function

* new orfs method for Seq based on three_frame_orfs function

* new orfs_to_features method for Dseqrecord

* new extract_from_text functions that also returns the intervening text between sequences

* bugfix orfs for Seq and Dsecrecord

* added crispr tests

* added pairwise for older Python versions

* older type hint

* Deploying to gh-pages from @ da3e7e9 🚀

* Deploying to gh-pages from @ 5be4f9d 🚀

* Deploying to gh-pages from @ b37a17c 🚀

* Deploying to gh-pages from @ 11aae3c 🚀

* Deploying to gh-pages from @ 0f95223 🚀

* try to build docs locally on gh-pages

* try to build gh pages

* try to build gh pages

* fix

* added sphinx ext

* Deploying to gh-pages from @ bc08a36 🚀

* try fix docs

* build docs

* clean

* redirect docs badge to action

* redirect docs badge to action

* fix readme links

* fix readme

* fix

* try to fix test error

* fix bug that recognized parts of re enzyme names as other enzymes

* added comment with number of enzymes

* changed number of expected enzymes to the correct number 621

* more informative error msg

* closes #216 (2)

* closes #196

* vscode and poetry settings added

* fix test

* add locations_overlap to utils

* Issue 238 (#239)

* closes #238

* fix notebook

* closes #240

* atomically write default config

* optimisation for #237

* fix python 3.8 typing

* include neb calculator and its tests

* fix design and add tests

* example commit for #176

* Documentation notebooks 2 (#272)

* Documentation notebooks (#271)

* added documentation for dseq.py

* fixed docs for Dseq.py

* fixed docs for Dseq.py

* add hook

* fix exclusions and run hook

* strip outputs of Dseq.ipynb

* update Dseq notebook

* placed notebooks in docs

* added looped and shifted methods in Dseq docs

* added docs for importing files using pydna

* added some Dseqrecord docs

* added docs+examples for Dseq_Features

* added origin spanning feats and removing feats for Dseq_Features

* some comments and todos

* added restriction page

* updated Importing_Seq page

* updated Dseq_Feature Page w/examples

* added restrict+ligate notebook

* added some PCR notes

* added examples, prints

* added tm and design

* fixed tm_default docs

* added gibson assembly

* some comments on current progress

* gibson

* fixed comments, added gibson example and CRISPR

* added Restriction example

* added Gibson example

* closes #256

* run pre-commit

* alternative example for gibson

* gibson updated example

* modified crispr

* modified crispr

* feedback changes for #260

* best practices for qualifiers

---------

Co-authored-by: Pei-Lun Xie <[email protected]>
Co-authored-by: Pei-Lun Xie <[email protected]>

* remove unnecessary file

* remove dir exclusions

* exclude test notebooks

---------

Co-authored-by: Pei-Lun Xie <[email protected]>
Co-authored-by: Pei-Lun Xie <[email protected]>

* update contribution guidelines (#274)

* update CI action to enforce hooks (#277)

* update CI action to enforce hooks

* update action

* update: Added google badge to all notebooks issue #266  (#275)

* fourth trt

* final file added

* update: added installation of pydna

* added seguid stamp to Genbank sequence files

* fix test sequence file

* dependabot monthly

* New CRISPR example notebook (#260) (#284)

* fourth trt

* final file added

* update: added installation of pydna

* update: added CRIPSR examples in notebooks issue #259

* update: added google badge issue #266

* Polished Example CRISPR notebook

---------

Co-authored-by: Manuel Lera-Ramirez <[email protected]>

* Updated notebooks (#295)

* updated example_restriction (#285)

Co-authored-by: Pei-Lun Xie <[email protected]>

* small fixes (#294)

* allow run all on notebooks that have pip install for google colab

---------

Co-authored-by: Pei-Lun Xie <[email protected]>

* progress towards #261

* WIP

* remove code image from README for #261

* more README updates + make requirements.txt

* add requirements file

* fix configuration

* typing for PrettyTable

* typing for codon dicts

* typing for Seq

* typing for FakeSeq

* typing for Genbank

* typing for sequence_picker module

* typing for common_sub_strings module

* typing for Assembly.__init__ and Assembly.__repr__

* Bump pillow from 10.3.0 to 10.4.0

Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.3.0 to 10.4.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](python-pillow/Pillow@10.3.0...10.4.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump autopep8 from 2.1.0 to 2.3.1

Bumps [autopep8](https://github.com/hhatto/autopep8) from 2.1.0 to 2.3.1.
- [Release notes](https://github.com/hhatto/autopep8/releases)
- [Commits](hhatto/autopep8@v2.1.0...v2.3.1)

---
updated-dependencies:
- dependency-name: autopep8
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump black from 24.4.2 to 24.8.0

Bumps [black](https://github.com/psf/black) from 24.4.2 to 24.8.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@24.4.2...24.8.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump sphinx-rtd-theme from 2.0.0 to 3.0.0

Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 2.0.0 to 3.0.0.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](readthedocs/sphinx_rtd_theme@2.0.0...3.0.0)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump prettytable from 3.10.0 to 3.11.0

Bumps [prettytable](https://github.com/jazzband/prettytable) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/jazzband/prettytable/releases)
- [Changelog](https://github.com/jazzband/prettytable/blob/main/CHANGELOG.md)
- [Commits](prettytable/prettytable@3.10.0...3.11.0)

---
updated-dependencies:
- dependency-name: prettytable
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* closes #261 (#297)

* tests for #281 #279, add type to pcr (#298)

* update codecov action for #242

* Issue 270 (#301)

* closes #270

* closes #269 by adding an example notebook + extra tests

* closes #288, includes the graphics in docs notebook

* added example.ipynb to tests folder

* removed example.ipynb

* deal with Tm = 0

* fix notebook export related to #279

* New docs (#304)

* new docs

* update action

* update action

* fix typo in action

* update README + closes #305

* improve docs

* document how docs work

* fix autogen_docs.sh

* fix crispr docstring

* Fix link in README (#310)

* Fix action (#311)

* fix action

* fix action

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: BjornFJohansson <[email protected]>
Co-authored-by: BjornFJohansson <[email protected]>
Co-authored-by: Pei-Lun Xie <[email protected]>
Co-authored-by: Jerry Xu <[email protected]>
Co-authored-by: Pei-Lun Xie <[email protected]>
Co-authored-by: Lucas Levassor <[email protected]>
Co-authored-by: Kawin <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel García Ruano <[email protected]>
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