Skip to content

Commit e1138f2

Browse files
authored
Merge pull request #176 from broadinstitute/namespace-packages
Restructure as namespace packages
2 parents 3d29a9b + 37982aa commit e1138f2

32 files changed

+79
-54
lines changed

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Documentation
22

3-
Documentation for gnomad_hail is generated using [Sphinx](https://www.sphinx-doc.org/en/master/).
3+
Documentation for gnomad is generated using [Sphinx](https://www.sphinx-doc.org/en/master/).
44

55
To build the documentation, run:
66

77
```
8-
cd /path/to/gnomad_hail
8+
cd /path/to/gnomad
99
pip install -r requirements.txt
1010
pip install -r docs/requirements.txt
1111
./docs/build.sh

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
from directives import AutoModuleSummary
88

9-
# Add gnomad_hail to import path.
9+
# Add gnomad to import path.
1010
sys.path.insert(0, str(Path(__file__).parent.parent))
1111

1212

13-
project = "gnomad_hail"
13+
project = "gnomad"
1414
version = release = "master"
1515

1616
extensions = [
@@ -113,4 +113,4 @@ def get_annotation_module(annotation):
113113

114114

115115
def setup(app):
116-
app.add_directive("gnomadhail_automodulesummary", AutoModuleSummary)
116+
app.add_directive("gnomad_automodulesummary", AutoModuleSummary)

docs/generate_api_reference.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import re
1212
import sys
1313

14-
# Add gnomad_hail to import path.
14+
# Add gnomad to import path.
1515
sys.path.insert(0, str(pathlib.Path(os.path.abspath(__file__)).parent.parent))
1616

1717
ROOT_PACKAGE_PATH = str(
18-
pathlib.Path(os.path.abspath(__file__)).parent.parent / "gnomad_hail"
18+
pathlib.Path(os.path.abspath(__file__)).parent.parent / "gnomad"
1919
)
2020

2121
DOCS_DIRECTORY = str(pathlib.Path(os.path.abspath(__file__)).parent)
@@ -69,7 +69,7 @@ def format_title(title):
6969
7070
{module_doc}
7171
72-
.. gnomadhail_automodulesummary:: {module_name}
72+
.. gnomad_automodulesummary:: {module_name}
7373
7474
.. automodule:: {module_name}
7575
"""
@@ -133,4 +133,14 @@ def write_package_doc(package_name):
133133

134134

135135
if __name__ == "__main__":
136-
write_package_doc("gnomad_hail")
136+
packages = ["resources", "utils"]
137+
for pkg in packages:
138+
write_package_doc(f"gnomad.{pkg}")
139+
140+
root_doc = PACKAGE_DOC_TEMPLATE.format(
141+
title=format_title("gnomad"),
142+
package_doc="",
143+
module_links="\n ".join(f"{pkg} <{pkg}/index>" for pkg in packages),
144+
)
145+
146+
write_file(os.path.join(DOCS_DIRECTORY, "api_reference", "index.rst"), root_doc)

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
gnomad_hail
2-
===========
1+
gnomad
2+
======
33

44
This package contains a number of `Hail <https://hail.is>`_ utility functions
55
and scripts for the `gnomAD project <https://gnomad.broadinstitute.org>`_ and
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from gnomad_hail.resources.resource_utils import (
1+
from gnomad.resources.resource_utils import (
22
DataException,
33
PedigreeResource,
44
TableResource,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from gnomad_hail.resources.resource_utils import TableResource, BlockMatrixResource
2-
from gnomad_hail.resources.grch37.gnomad import CURRENT_EXOME_RELEASE, CURRENT_GENOME_RELEASE
1+
from gnomad.resources.resource_utils import TableResource, BlockMatrixResource
2+
from gnomad.resources.grch37.gnomad import CURRENT_EXOME_RELEASE, CURRENT_GENOME_RELEASE
33
from typing import Optional
44

55

gnomad_hail/resources/grch37/reference_data.py renamed to gnomad/resources/grch37/reference_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from gnomad_hail.resources.resource_utils import (
1+
from gnomad.resources.resource_utils import (
22
MatrixTableResource,
33
TableResource,
44
VersionedMatrixTableResource,

0 commit comments

Comments
 (0)