Skip to content

Commit

Permalink
Merge pull request #71 from uclahs-cds/yashpatel-fix-choices
Browse files Browse the repository at this point in the history
Fix choices
  • Loading branch information
yashpatel6 authored Sep 6, 2024
2 parents a4e99e0 + b52420d commit 23b7b4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
---

## [Unreleased]

---

## [1.3.0] - 2024-09-04
### Added
- `sanitize_uclahs_cds_id` function
- Functional testing framework with concrete tests for `methods.set_env()`
- Functional test for `bam_parser.parse_bam_header()`.
- Functional test for `bam_parser.parse_bam_header()`
- Dump parameters with `json_extractor.store_params_json()`
- Option to allow empty fields in a CSV to be parsed without error
- Function to save process logs, even after failure

### Fixed
- Fixed retry for potentially undefined variable `proc_name_keys`. #57
- Fix retry for potentially undefined variable `proc_name_keys` #57
- Fix `schema.check_write_permission` when `null` is returned by `getParentFile` #59
- Fix checking of `choices` to properly check choices when given

### Changed
- Allow `set_resources_allocation` to use maximum allocation values defined in params
- Add `def`s to multiple variables that should not be globally defined
- Allow specific schema validation function to accept pre-loaded schema as input
- Add try-catch to schema validation to log the parameter being failed to validate.
- Add try-catch to schema validation to log the parameter being failed to validate
- Rename `check_bam_list` function to more general `check_readable_file_list`
- Allow Path schema type to be a GString

Expand Down
10 changes: 9 additions & 1 deletion config/schema/schema.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ schema {
path_types = ['Path']
custom_types = [:]

single_choice_types = [
'String',
'Path',
'Number',
'Integer'
]

/**
* Load the schema file.
Expand Down Expand Up @@ -208,7 +214,9 @@ schema {
schema.check_path(options[name], properties.mode)
} else if (schema.custom_types.containsKey(properties.type)) {
schema.custom_types[properties.type](options, name, properties)
} else if (properties.containsKey('choices')) {
}

if (properties.type in schema.single_choice_types && properties.containsKey('choices')) {
schema.check_choices_singular(options, name, properties.choices)
}
} else {
Expand Down

0 comments on commit 23b7b4e

Please sign in to comment.