Skip to content

Commit 3a9c7c6

Browse files
committed
Add script
1 parent 0f5a35f commit 3a9c7c6

7 files changed

Lines changed: 39 additions & 11 deletions

File tree

src/semra/landscape/anatomy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
Web Application
2929
***************
3030
The pre-built artifacts for this mapping database can be downloaded from Zenodo
31-
at |anatomy| and unzipped. The web application can be run
31+
at |anatomyimg| and unzipped. The web application can be run
3232
locally on Docker from inside the folder where the data was unzipped with:
3333
3434
.. code-block:: console
@@ -46,7 +46,7 @@
4646
Finally, navigate in your web browser to http://localhost:8773 to see the web
4747
application.
4848
49-
.. |anatomy| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091803.svg
49+
.. |anatomyimg| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091803.svg
5050
:target: https://doi.org/10.5281/zenodo.11091803
5151
5252
""" # noqa:D205,D400

src/semra/landscape/cell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
Web Application
3333
***************
3434
The pre-built artifacts for this mapping database can be downloaded from Zenodo
35-
at |cell| and unzipped. The web application can be run
35+
at |cellimg| and unzipped. The web application can be run
3636
locally on Docker from inside the folder where the data was unzipped with:
3737
3838
.. code-block:: console
@@ -50,7 +50,7 @@
5050
Finally, navigate in your web browser to http://localhost:8773 to see the web
5151
application.
5252
53-
.. |cell| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091581.svg
53+
.. |cellimg| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091581.svg
5454
:target: https://doi.org/10.5281/zenodo.11091581
5555
5656
""" # noqa:D205,D400

src/semra/landscape/complex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
Web Application
3131
***************
3232
The pre-built artifacts for this mapping database can be downloaded from Zenodo
33-
at |complex| and unzipped. The web application can be run
33+
at |compleximg| and unzipped. The web application can be run
3434
locally on Docker from inside the folder where the data was unzipped with:
3535
3636
.. code-block:: console
@@ -48,7 +48,7 @@
4848
Finally, navigate in your web browser to http://localhost:8773 to see the web
4949
application.
5050
51-
.. |complex| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091422.svg
51+
.. |compleximg| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091422.svg
5252
:target: https://doi.org/10.5281/zenodo.11091422
5353
5454
""" # noqa:D205,D400

src/semra/landscape/disease.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
Web Application
4242
***************
4343
The pre-built artifacts for this mapping database can be downloaded from Zenodo
44-
at |disease| and unzipped. The web application can be run
44+
at |diseaseimg| and unzipped. The web application can be run
4545
locally on Docker from inside the folder where the data was unzipped with:
4646
4747
.. code-block:: console
@@ -59,7 +59,7 @@
5959
Finally, navigate in your web browser to http://localhost:8773 to see the web
6060
application.
6161
62-
.. |disease| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091886.svg
62+
.. |diseaseimg| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11091886.svg
6363
:target: https://doi.org/10.5281/zenodo.11091886
6464
6565
""" # noqa:D205,D400

src/semra/landscape/gene.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
Web Application
3636
***************
3737
The pre-built artifacts for this mapping database can be downloaded from Zenodo
38-
at |gene| and unzipped. The web application can be run
38+
at |geneimg| and unzipped. The web application can be run
3939
locally on Docker from inside the folder where the data was unzipped with:
4040
4141
.. code-block:: console
@@ -53,7 +53,7 @@
5353
Finally, navigate in your web browser to http://localhost:8773 to see the web
5454
application.
5555
56-
.. |gene| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11092013.svg
56+
.. |geneimg| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11092013.svg
5757
:target: https://doi.org/10.5281/zenodo.11092013
5858
5959
""" # noqa:D205,D400

src/semra/landscape/taxrank.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
Finally, navigate in your web browser to http://localhost:8773 to see the web
3636
application.
3737
38-
.. |taxrank| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.None.svg
38+
.. |taxrankimg| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.None.svg
3939
:target: https://doi.org/10.5281/zenodo.None
4040
4141
""" # noqa:D205,D400

src/semra/landscape/update_docs.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""Update the module level docstrings for landscape configurations."""
2+
3+
from semra.landscape import CONFIGURATIONS
4+
5+
from pathlib import Path
6+
import click
7+
8+
__all__ = [
9+
"update_landscape_module_docstrings",
10+
]
11+
12+
HERE = Path(__file__).parent.resolve()
13+
14+
15+
@click.command()
16+
def update_landscape_module_docstrings() -> None:
17+
"""Update the module level docstrings for landscape configurations."""
18+
for conf in CONFIGURATIONS:
19+
path = HERE.joinpath(conf.key).with_suffix(".py")
20+
text = path.read_text()
21+
lines = text.splitlines()
22+
idx = min(i for i, line in enumerate(lines[1:], start=1) if line.startswith('"""'))
23+
new = conf._get_header_text()
24+
path.write_text(new + "\n".join(lines[idx + 1:]) + "\n")
25+
26+
27+
if __name__ == '__main__':
28+
update_landscape_module_docstrings()

0 commit comments

Comments
 (0)