Commit 32cafe5
authored
Increased robustness of opconvertor.py when running on some experimental data (#456)
* Made build_nice_OPdict more robust in corner cases.
- OP data for some experiments is lacking standard deviation values
leading to an IndexError, added an additional length check
- added a check wether the atom is actually contained in the mapping dict to avoid a KeyError, missing atoms are skipped
- 'nice_OPdict' contain a lot of NaN, added a function to replace those because it almost certainly will be dumped to JSON
* Formatting with Ruff
* Added a rudimentary test to test_op.py to demonstrate the case.
- Until we decide on test data, it cannot be run
* Linting#
* Trying to skip that test.
* Trying to manually pass the CI env
* cannot pass passenv twice
* Still trying to skip it.
* trying more things
* testing
* Skipping is working now, trying to skip in CI only
* value checking for opconverter
* reverted some of the changes as requested
* Added a more defensive handling of the case where Atom formats are not
matched by the renamer.
We are now throwing a ValueException with speaking error message.
This is a more defensive approach than simply risking NoneType is not subsettable errors.
* Linting...1 parent 65874d4 commit 32cafe5
2 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| 99 | + | |
| 100 | + | |
87 | 101 | | |
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
91 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
92 | 111 | | |
93 | 112 | | |
94 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments