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

Generated catalog figures for each published demographic model #1034

Merged
merged 3 commits into from
Oct 19, 2021

Conversation

aabiddanda
Copy link
Contributor

@aabiddanda aabiddanda commented Oct 18, 2021

For each demographic model in stdpopsim that has a catalog entry in the documentation, the build process will generate a plot via the demesdraw package that is saved to a directory and included in the HTML building.

This represents an interim solution to #962 & #149, subject to changes in the demes and demesdraw APIs. Some additional smaller edits are:

  • grammatical typo in docs/development.rst
  • plural of Yoruba is actually also "Yoruba"

The ideal here is that for each new model added to the catalog (if the model corresponds to a demes model), it will automatically generate a graphical representation within the documentation. Any suggestions / stylistic edits welcome!

…age: demesdraw [-h] [--version] {tubes,size_history} ...

Draw a Demes model.

positional arguments:
  {tubes,size_history}
    tubes               Plot a demes-as-tubes schematic of the model and the
                        demes' relationships.
    size_history        Plot population size as a function of time for each
                        deme in the model.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
@aabiddanda aabiddanda marked this pull request as draft October 18, 2021 19:15
@aabiddanda aabiddanda marked this pull request as ready for review October 18, 2021 19:22
@codecov
Copy link

codecov bot commented Oct 18, 2021

Codecov Report

Merging #1034 (ee66346) into main (31ef60c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1034   +/-   ##
=======================================
  Coverage   98.65%   98.65%           
=======================================
  Files          89       89           
  Lines        2899     2899           
  Branches      348      348           
=======================================
  Hits         2860     2860           
  Misses         31       31           
  Partials        8        8           
Impacted Files Coverage Δ
stdpopsim/catalog/HomSap/demographic_models.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31ef60c...ee66346. Read the comment docs.

Copy link
Member

@grahamgower grahamgower left a comment

Choose a reason for hiding this comment

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

This is great, thanks for taking this on @aabiddanda. I just have a few quibbles noted below.

docs/_ext/speciescatalog.py Outdated Show resolved Hide resolved
docs/_ext/speciescatalog.py Outdated Show resolved Hide resolved
docs/_ext/speciescatalog.py Outdated Show resolved Hide resolved
@grahamgower
Copy link
Member

grahamgower commented Oct 19, 2021

It looks like the pre-commit test is failing too. See here, for how to set that up so your code will automatially be checked when you commit.

@grahamgower grahamgower merged commit e1c1e72 into popsim-consortium:main Oct 19, 2021
@grahamgower
Copy link
Member

I see the images in the catalog when I build locally, but this doesn't seem to have propagated into readthedocs (e.g. https://stdpopsim.readthedocs.io/en/latest/catalog.html#sec_catalog_homsap_models_outofafrica_3g09). I thought that after #946 RTD was working again. @jeromekelleher do you get mails from RTD when it fails?

@jeromekelleher
Copy link
Member

Yes, sorry @grahamgower I have been getting failure emails from RTD but I didn't pay much attention. I'm afraid this has very little chance of working there, the environment is very limited.

@grahamgower
Copy link
Member

Ah, damn. Same old RTD I guess.

The alternate docs home is still running fine though: https://popsim-consortium.github.io/stdpopsim-docs/main/catalog.html

@jeromekelleher
Copy link
Member

Excellent! Should we just turn off RTD then?

@grahamgower
Copy link
Member

Is there a way to do a redirect?

@jeromekelleher
Copy link
Member

@benjeffery, you did this with the tskit repos - what's the least-bad option for transitioning off RTD? We have a site up and running for the dev branch.

@benjeffery
Copy link
Collaborator

For our repos, after some experimentation, that the attached were the redirects that worked best:
Screenshot from 2021-10-21 11-56-00
Very tedious, but it works.

@izabelcavassim
Copy link
Member

Just here to say that the demography figures are beautiful and so useful @aabiddanda! Well done :)

@petrelharp
Copy link
Contributor

Agree!

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.

6 participants