Skip to content

Commit

Permalink
Merge pull request #269 from microbiomedata/env_triad_docs
Browse files Browse the repository at this point in the history
Add plant_associated, water, and sediment enum regeneration targets
  • Loading branch information
turbomam authored Nov 14, 2024
2 parents 763bebe + efca1a8 commit fca6c3a
Show file tree
Hide file tree
Showing 4 changed files with 428 additions and 330 deletions.
27 changes: 17 additions & 10 deletions project.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,25 +184,32 @@ local/nmdc.yaml

########### ENV Triad PV generation ##########
# Specify that 'ingest-triad' is a phony target, meaning it doesn't correspond to an actual file
.PHONY: ingest-triad
.PHONY: ingest-triad temp_target
WATCHED_DIR := notebooks/environmental_context_value_sets
WATCHED_FILES := $(shell find $(WATCHED_DIR) -type f)
# Match only .tsv files with the specific naming convention
WATCHED_FILES := $(shell find $(WATCHED_DIR) -type f \( \
-name 'post_google_sheets_*_local_scale.tsv' -o \
-name 'post_google_sheets_*_broad_scale.tsv' -o \
-name 'post_google_sheets_*_medium.tsv' \))

# Define an intermediate target to prevent re-triggering
.INTERMEDIATE: temp_target

# Main target to run ingestion commands, depending on the intermediate target
ingest-triad: temp_target

# Intermediate target that has all dependencies
# Intermediate target that dynamically processes matching TSV files
temp_target: $(WATCHED_FILES) src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml
$(RUN) inject-env-triad-terms -f notebooks/environmental_context_value_sets/soil/env_local_scale/post_google_sheets_soil_env_local_scale.tsv -i src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml -o src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml
$(RUN) inject-env-triad-terms -f notebooks/environmental_context_value_sets/soil/env_medium/post_google_sheets_soil_env_medium.tsv -i src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml -o src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml
$(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

@echo "Processing all matching TSV files in $(WATCHED_DIR)..."
@for tsv_file in $(WATCHED_FILES); do \
echo "Processing $$tsv_file..."; \
$(RUN) inject-env-triad-terms -f $$tsv_file \
-i src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml \
-o src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml || exit 1; \
done
@touch temp_target

test-deploy-docs-gh-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 fca6c3a

Please sign in to comment.