Skip to content

Commit

Permalink
Fix a bug in parameter filter
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 1, 2024
1 parent a4a019e commit 8c181fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,10 @@ total
```

* `issue-by-category.csv`: the counts of issues by categories. Columns:
* `id` the identifier of error category
* `category` the name of the category
* `instances` the number of instances of errors within the category (one record might have multiple instances of the same error)
* `records` the number of records having at least one of the errors within the category
* `id` the identifier of error category
* `category` the name of the category
* `instances` the number of instances of errors within the category (one record might have multiple instances of the same error)
* `records` the number of records having at least one of the errors within the category

```csv
id,category,instances,records
Expand Down
6 changes: 4 additions & 2 deletions common-script
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ do_marc_history() {

run marc-history
./formatter --selector "$SELECTOR" --defaultRecordType BOOKS ${PARAMS} --separator "," \
--outputDir ${OUTPUT_DIR}/ --fileName "marc-history.csv" ${MARC_DIR}/${MASK} &> ${LOG_DIR}/marc-history.log
--outputDir ${OUTPUT_DIR}/ --fileName "marc-history.csv" ${MARC_DIR}/${MASK} \
&> ${LOG_DIR}/marc-history.log
# | grep -v '008~7-10,008~0-5' \

untrace
Expand Down Expand Up @@ -465,7 +466,8 @@ do_export_schema_files() {

do_export_cli_parameters() {
. ./common-variables
java -cp $JAR de.gwdg.metadataqa.marc.cli.CliParameterDefinitionsExporter | jq . > cli-parameter-definitions.json
java -cp $JAR de.gwdg.metadataqa.marc.cli.CliParameterDefinitionsExporter \
| jq . > cli-parameter-definitions.json
log "CLI parameters has been exported into cli-parameter-definitions.json"
}

Expand Down
4 changes: 4 additions & 0 deletions qa-catalogue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ ANALYSES: ${ANALYSES:-}
CATALOGUE: ${CATALOGUE:-}
BASE_INPUT_DIR (input): ${BASE_INPUT_DIR}
INPUT_DIR (input-dir): ${INPUT_DIR:-}
MARC_DIR ${MARC_DIR:-}
MASK: ${MASK}
NAME: ${NAME}
BASE_OUTPUT_DIR (output): ${BASE_OUTPUT_DIR}
Expand Down Expand Up @@ -113,6 +114,9 @@ fail() {
exit 1
}

echo ${1:-}
exit

# run actual analysis
./common-script ${1:-} || fail

Expand Down
6 changes: 5 additions & 1 deletion scripts/utils/parameter-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
$parameters = $argv;
$full_definition = json_decode(file_get_contents('cli-parameter-definitions.json'));
if (!isset($full_definition->{$type})) {
die('ERROR: undefined type: ' . $type . LN);
if (in_array($type, ['marc-history', 'bl-classification'])) {
$type = 'common';
} else {
die('ERROR: undefined type: ' . $type . LN);
}
}

$param_definitions = array_merge($full_definition->common, $full_definition->{$type});
Expand Down

0 comments on commit 8c181fc

Please sign in to comment.