Commit bb8b379
authored
feat: add
* Add `sibasevalue` function
* Define uexpand for quantities with Dimensions
* Define `sibasevalue(q)=ustrip(uexpand(q))
When obtaining the numerical value of a quantity (e.g. for computations
with sparse direct solvers implemented in other languages) via `ustrip`,
there is danger of mixing up the right values when quantities with
symbolic dimensions come into play.
By adding a `uexpand` method for quantities with dimensions,
which just passes through the value one can write code consistent
for both flavors of quantities.
`sibasevalue` shall help to remove a little bit of boilerplate
and explicitely hint at the characteristics of the returned value.
* Update format in test/unittests.jl
Co-authored-by: Miles Cranmer <[email protected]>
* remove unintended dependency in docs/Project.toml
* sibasevalue -> ustripexpand
* fix missing export of ustripexpand
* implement suggested changes
* define ustripexpand for UnionAbstractQuantity
* docs: improve docstring
* docs: clean up
* style: sort exports
* test: tweak testsustripexpand (#162)1 parent 9625403 commit bb8b379
File tree
5 files changed
+34
-6
lines changed- docs/src
- src
- test
5 files changed
+34
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
| 159 | + | |
157 | 160 | | |
| 161 | + | |
| 162 | + | |
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
161 | | - | |
| 166 | + | |
162 | 167 | | |
163 | 168 | | |
164 | 169 | | |
| |||
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
254 | 268 | | |
255 | 269 | | |
256 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
382 | 386 | | |
383 | 387 | | |
384 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
858 | 866 | | |
| 867 | + | |
859 | 868 | | |
860 | 869 | | |
861 | 870 | | |
| |||
0 commit comments