Skip to content

Commit

Permalink
Merge pull request #264 from microbiomedata/env_triad_docs
Browse files Browse the repository at this point in the history
Add makefile targets to test and build docs locally, make sure ingest-triad results are injected into docs
  • Loading branch information
pkalita-lbl authored Nov 12, 2024
2 parents af390cf + 9a5dc24 commit f7c1ee5
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 147,220 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
clean \
schema-clean \
src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml \
ingest-triad \
project/json/nmdc_submission_schema.json
- name: Build documentation.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Generate project files
run: |
make clean schema-clean src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml
make clean schema-clean src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml ingest-triad
poetry dynamic-versioning
make gen-project
make project/json/nmdc_submission_schema.json
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ gendoc: $(DOCDIR)
cp $(SRC)/docs/*md $(DOCDIR) ; \
$(RUN) gen-doc ${GEN_DARGS} -d $(DOCDIR) $(SOURCE_SCHEMA_PATH)

testdoc: gendoc serve
testdoc: test_deploy_docs_action gendoc serve

MKDOCS = $(RUN) mkdocs
mkd-%:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,65 +195,42 @@
"execution_count": 13
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-11-11T23:11:28.617521Z",
"start_time": "2024-11-11T23:11:28.615082Z"
}
},
"metadata": {},
"cell_type": "code",
"source": "",
"id": "df718b5631cbf733",
"outputs": [],
"execution_count": null
"execution_count": null,
"source": "soils_with_local_or_override_exclusion_justification",
"id": "d2bc11248ba7bfab"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-11-11T23:11:28.664848Z",
"start_time": "2024-11-11T23:11:28.661387Z"
}
},
"metadata": {},
"cell_type": "code",
"source": "soils_reiterating_broad_or_local = set(soils_with_local_or_override_exclusion_justification['sole_soil'].unique())\n",
"id": "bff5dcb1cee90fb",
"outputs": [],
"execution_count": 14
"execution_count": null,
"source": "soils_reiterating_broad_or_local = set(soils_with_local_or_override_exclusion_justification['sole_soil'].unique())\n",
"id": "b8f217ba6fd412b5"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-11-11T23:11:28.738105Z",
"start_time": "2024-11-11T23:11:28.708626Z"
}
},
"metadata": {},
"cell_type": "code",
"source": "adapter = get_adapter(adapter_string)",
"id": "7709e378f4d117eb",
"outputs": [],
"execution_count": 15
"execution_count": null,
"source": "adapter = get_adapter(adapter_string)",
"id": "b98d95693fb26e64"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-11-11T23:11:28.765428Z",
"start_time": "2024-11-11T23:11:28.762821Z"
}
},
"metadata": {},
"cell_type": "code",
"source": "targets = set()",
"id": "1bbc3b1ad9958a37",
"outputs": [],
"execution_count": 16
"execution_count": null,
"source": "targets = set()",
"id": "38bfe1d58a2a2e6e"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-11-11T23:11:28.977259Z",
"start_time": "2024-11-11T23:11:28.804207Z"
}
},
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"# accumulate subclasses of the target classes (by label)\n",
"# \n",
Expand All @@ -264,151 +241,11 @@
" if adapter.label(d) not in soils_reiterating_broad_or_local:\n",
" targets.add(d)\n",
" else:\n",
" print(\n",
" f\"Excluding {d} {adapter.label(d)} because its differentia can be expressed in terms of the broad or local scale\")\n",
" print(soils_with_local_or_override_exclusion_justification[\n",
" soils_with_local_or_override_exclusion_justification['sole_soil'] == adapter.label(d)])\n",
"\n",
" print(f\"Excluding {d} {adapter.label(d)} because its differentia can be expressed in terms of the broad or local scale\")\n",
" \n",
"print(len(targets))"
],
"id": "6ecbf0cd88edec66",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Excluding ENVO:00002263 garden soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"59 ENVO:00002263 True False garden soil BFO:0000050 \n",
"60 ENVO:00002263 True False garden soil RO:0001025 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable o o_is_soil \\\n",
"59 part of part of True ENVO:00000011 False \n",
"60 located in located in True ENVO:00000011 False \n",
"\n",
" o_is_reasonable_other olab slab_olab_cosine sole_reasonable_other \\\n",
"59 True garden 0.738549 garden \n",
"60 True garden 0.738549 garden \n",
"\n",
" sole_soil override \n",
"59 garden soil NaN \n",
"60 garden soil NaN \n",
"Excluding ENVO:00005773 pasture soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"159 ENVO:00005773 True False pasture soil RO:0001025 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable o o_is_soil \\\n",
"159 located in located in True ENVO:00000266 False \n",
"\n",
" o_is_reasonable_other olab slab_olab_cosine sole_reasonable_other \\\n",
"159 True pasture 0.763763 pasture \n",
"\n",
" sole_soil override \n",
"159 pasture soil NaN \n",
"Excluding ENVO:00005772 orchard soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"156 ENVO:00005772 True False orchard soil BFO:0000050 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable o o_is_soil \\\n",
"156 part of part of True ENVO:00000115 False \n",
"\n",
" o_is_reasonable_other olab slab_olab_cosine sole_reasonable_other \\\n",
"156 True orchard 0.763763 orchard \n",
"\n",
" sole_soil override \n",
"156 orchard soil exclude soil \n",
"Excluding ENVO:00002260 dune soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"53 ENVO:00002260 True False dune soil BFO:0000050 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable o o_is_soil \\\n",
"53 part of part of True ENVO:00000170 False \n",
"\n",
" o_is_reasonable_other olab slab_olab_cosine sole_reasonable_other \\\n",
"53 True dune 0.666667 dune \n",
"\n",
" sole_soil override \n",
"53 dune soil NaN \n",
"Excluding ENVO:02000138 mangrove biome soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab \\\n",
"209 ENVO:02000138 True False mangrove biome soil \n",
"\n",
" p plab p_lab_or_id relation_is_reasonable o \\\n",
"209 RO:0001025 located in located in True ENVO:01000181 \n",
"\n",
" o_is_soil o_is_reasonable_other olab slab_olab_cosine \\\n",
"209 False False mangrove biome 0.858395 \n",
"\n",
" sole_reasonable_other sole_soil override \n",
"209 mangrove biome mangrove biome soil exclude soil \n",
"Excluding ENVO:00005774 peat soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"227 ENVO:00000044 False True peatland RO:0002473 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable \\\n",
"227 composed primarily of composed primarily of True \n",
"\n",
" o o_is_soil o_is_reasonable_other olab \\\n",
"227 ENVO:00005774 True False peat soil \n",
"\n",
" slab_olab_cosine sole_reasonable_other sole_soil override \n",
"227 0.589256 peatland peat soil NaN \n",
"Excluding ENVO:00005780 greenhouse soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p plab p_lab_or_id \\\n",
"401 NaN NaN NaN NaN NaN NaN NaN \n",
"\n",
" relation_is_reasonable o o_is_soil o_is_reasonable_other olab \\\n",
"401 False NaN NaN NaN NaN \n",
"\n",
" slab_olab_cosine sole_reasonable_other sole_soil override \n",
"401 NaN greenhouse greenhouse soil exclude soil \n",
"Excluding ENVO:00005777 steppe soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"168 ENVO:00005777 True False steppe soil RO:0001025 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable o o_is_soil \\\n",
"168 located in located in True ENVO:00000262 False \n",
"\n",
" o_is_reasonable_other olab slab_olab_cosine sole_reasonable_other \\\n",
"168 True steppe 0.738549 steppe \n",
"\n",
" sole_soil override \n",
"168 steppe soil NaN \n",
"Excluding ENVO:00005749 farm soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p plab p_lab_or_id \\\n",
"400 NaN NaN NaN NaN NaN NaN NaN \n",
"\n",
" relation_is_reasonable o o_is_soil o_is_reasonable_other olab \\\n",
"400 False NaN NaN NaN NaN \n",
"\n",
" slab_olab_cosine sole_reasonable_other sole_soil override \n",
"400 NaN farm farm soil exclude soil \n",
"Excluding ENVO:00005761 meadow soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p \\\n",
"136 ENVO:00005761 True False meadow soil BFO:0000050 \n",
"\n",
" plab p_lab_or_id relation_is_reasonable o o_is_soil \\\n",
"136 part of part of True ENVO:00000108 False \n",
"\n",
" o_is_reasonable_other olab slab_olab_cosine \\\n",
"136 True meadow ecosystem 0.678401 \n",
"\n",
" sole_reasonable_other sole_soil override \n",
"136 meadow ecosystem meadow soil NaN \n",
"Excluding ENVO:01001841 volcanic soil because its differentia can be expressed in terms of the broad or local scale\n",
" s s_is_soil s_is_reasonable_other slab p plab p_lab_or_id \\\n",
"402 NaN NaN NaN NaN NaN NaN NaN \n",
"\n",
" relation_is_reasonable o o_is_soil o_is_reasonable_other olab \\\n",
"402 False NaN NaN NaN NaN \n",
"\n",
" slab_olab_cosine sole_reasonable_other sole_soil override \n",
"402 NaN volcano volcanic soil exclude soil \n",
"119\n"
]
}
],
"execution_count": 17
"id": "8fc94afe92377c39"
},
{
"metadata": {
Expand Down
2 changes: 2 additions & 0 deletions project.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ temp_target: $(WATCHED_FILES) src/nmdc_submission_schema/schema/nmdc_submission_
$(RUN) inject-env-triad-terms -f notebooks/environmental_context_value_sets/soil/env_broad_scale/post_google_sheets_soil_env_broad_scale.tsv -i src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml -o src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml
touch temp_target

test_deploy_docs_action: clean schema-clean src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml ingest-triad project/json/nmdc_submission_schema.json

################################################

src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml: local/with_modifications.yaml project/thirdparty/GoldEcosystemTree.json
Expand Down
Loading

0 comments on commit f7c1ee5

Please sign in to comment.