-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76abd5d
commit a4f670a
Showing
4 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const ParseError = function(error) { | ||
let _error = error[0]; | ||
console.error(_error); | ||
_error = _error.match(/(?<=ValueError:\s).*/)[0]; | ||
return _error.toString(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {ParseError} from "../../src/utils/parsers"; | ||
import assert from "../helpers"; | ||
|
||
const check = function(func, input, output) { | ||
assert.equal(func(input), output); | ||
}; | ||
|
||
const error = [ | ||
'Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/bmds_server/analysis/models.py", line 237, in try_run_session return AnalysisSession.run(inputs, dataset_index, option_index) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/bmds_server/analysis/executor.py", line 134, in run session = cls.create(inputs, dataset_index, option_index) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/bmds_server/analysis/executor.py", line 140, in create dataset = build_dataset(inputs["datasets"][dataset_index]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/bmds_server/analysis/transforms.py", line 93, in build_dataset return schema.model_validate(dataset).deserialize() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/bmds/datasets/continuous.py", line 247, in deserialize ds = ContinuousDataset( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/bmds/datasets/continuous.py", line 104, in _init_ self._sort_by_dose_group() File "/usr/local/lib/python3.11/site-packages/bmds/datasets/continuous.py", line 116, in _sort_by_dose_group self._validate() File "/usr/local/lib/python3.11/site-packages/bmds/datasets/continuous.py", line 108, in _validate self._validate_summary_data() File "/usr/local/lib/python3.11/site-packages/bmds/datasets/continuous.py", line 23, in _validate_summary_data raise ValueError("Doses are not unique") ValueError: Doses are not unique', | ||
"", | ||
]; | ||
const result = "Doses are not unique"; | ||
|
||
describe("Parsing", function() { | ||
describe("ParseError", function() { | ||
it("parses out the correct error message", function() { | ||
check(ParseError, error, result); | ||
}); | ||
}); | ||
}); |