Skip to content

Commit

Permalink
Updated makerules 2024-06-14
Browse files Browse the repository at this point in the history
  • Loading branch information
digital-land-bot committed Jun 14, 2024
1 parent dd2be34 commit 5dc3fa8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions makerules/collection.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ second-pass:: collection

collect:: $(COLLECTION_CONFIG_FILES)
@mkdir -p $(RESOURCE_DIR)
digital-land collect $(ENDPOINT_CSV)
digital-land ${DIGITAL_LAND_OPTS} collect $(ENDPOINT_CSV)

collection::
digital-land collection-save-csv
digital-land ${DIGITAL_LAND_OPTS} collection-save-csv

clobber-today::
rm -rf $(LOG_FILES_TODAY) $(COLLECTION_INDEX)
Expand Down
14 changes: 7 additions & 7 deletions makerules/pipeline.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,26 @@ endif

define run-pipeline
mkdir -p $(@D) $(ISSUE_DIR)$(notdir $(@D)) $(COLUMN_FIELD_DIR)$(notdir $(@D)) $(DATASET_RESOURCE_DIR)$(notdir $(@D))
digital-land --dataset $(notdir $(@D)) $(DIGITAL_LAND_FLAGS) pipeline $(1) --issue-dir $(ISSUE_DIR)$(notdir $(@D)) --column-field-dir $(COLUMN_FIELD_DIR)$(notdir $(@D)) --dataset-resource-dir $(DATASET_RESOURCE_DIR)$(notdir $(@D)) $(PIPELINE_FLAGS) $< $@
digital-land ${DIGITAL_LAND_OPTS} --dataset $(notdir $(@D)) $(DIGITAL_LAND_FLAGS) pipeline $(1) --issue-dir $(ISSUE_DIR)$(notdir $(@D)) --column-field-dir $(COLUMN_FIELD_DIR)$(notdir $(@D)) --dataset-resource-dir $(DATASET_RESOURCE_DIR)$(notdir $(@D)) $(PIPELINE_FLAGS) $< $@
endef

define build-dataset =
mkdir -p $(@D)
time digital-land --dataset $(notdir $(basename $@)) dataset-create --output-path $(basename $@).sqlite3 $(^)
time digital-land ${DIGITAL_LAND_OPTS} --dataset $(notdir $(basename $@)) dataset-create --output-path $(basename $@).sqlite3 $(^)
time datasette inspect $(basename $@).sqlite3 --inspect-file=$(basename $@).sqlite3.json
time digital-land --dataset $(notdir $(basename $@)) dataset-entries $(basename $@).sqlite3 $@
time digital-land ${DIGITAL_LAND_OPTS} --dataset $(notdir $(basename $@)) dataset-entries $(basename $@).sqlite3 $@
mkdir -p $(FLATTENED_DIR)
time digital-land --dataset $(notdir $(basename $@)) dataset-entries-flattened $@ $(FLATTENED_DIR)
time digital-land ${DIGITAL_LAND_OPTS} --dataset $(notdir $(basename $@)) dataset-entries-flattened $@ $(FLATTENED_DIR)
md5sum $@ $(basename $@).sqlite3
csvstack $(ISSUE_DIR)$(notdir $(basename $@))/*.csv > $(basename $@)-issue.csv
mkdir -p $(EXPECTATION_DIR)
time digital-land expectations-dataset-checkpoint --output-dir=$(EXPECTATION_DIR) --specification-dir=specification --data-path=$(basename $@).sqlite3
time digital-land ${DIGITAL_LAND_OPTS} expectations-dataset-checkpoint --output-dir=$(EXPECTATION_DIR) --specification-dir=specification --data-path=$(basename $@).sqlite3
csvstack $(EXPECTATION_DIR)/**/$(notdir $(basename $@))-results.csv > $(basename $@)-expectation-result.csv
csvstack $(EXPECTATION_DIR)/**/$(notdir $(basename $@))-issues.csv > $(basename $@)-expectation-issue.csv
endef

collection::
digital-land collection-pipeline-makerules > collection/pipeline.mk
digital-land ${DIGITAL_LAND_OPTS} collection-pipeline-makerules > collection/pipeline.mk

-include collection/pipeline.mk

Expand Down Expand Up @@ -168,7 +168,7 @@ save-expectations::
# .. this assumes conversion is the same for every dataset, but it may not be soon
var/converted/%.csv: collection/resource/%
mkdir -p var/converted/
digital-land convert $<
digital-land ${DIGITAL_LAND_OPTS} convert $<

transformed::
@mkdir -p $(TRANSFORMED_DIR)
Expand Down

0 comments on commit 5dc3fa8

Please sign in to comment.