| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* fix bug in doAssertRaises when exception==Exception
* add testcase for doAssertRaises
|
| |
|
|
|
|
|
| |
* fixes #10148
* fix a typo
|
|
|
|
|
| |
* fix off by 1 error in `col` shown by toFileLineCol
* fix test failures
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ?
CDF is a standard ident in all things related to random numbers/sampling,
and full words "cumulativeDistributionFunction" would be silly long, in
this case, IMO. We use lowercase `cdf` to make it not look like a type,
remove all looping from `sample` letting callers do it. Besides just
side-stepping any `sampleSize` name choice, callers may want to filter
out samples anyway which this makes slightly simpler.
Also add two variants of `cumsum`, value return and in-place update
distinguished by the var-ness of the first argument. Add tests for
`int` and `float` for both `cumsum` and the new `sample`. (The sample
tests exercise the value return mode of `cumsum`.)
Functionality pre-this-PR `sample(a, w)` is now the almost as simple
`for i in 0..<n: sample(a, w.cumsum)`, but this new code factoring is
almost surely better. The statistical tests pass, as before.
* Address Araq comment in https://github.com/nim-lang/Nim/pull/10084
We can always add in some `var` version later if desired to save
memory, but this change now at least firms up the `sample` interface.
* Rename `cumsum` -> `cumsummed` to honor NEP1 style. Re-instate `cumsum` as
the in-place transformation. Test both in `tests/stdlib/tmath.nim` and use
`cumsummed` in the example code for sample since that's a simpler example.
* Fix requests from https://github.com/nim-lang/Nim/pull/10084 :
example in lib/pure/math.nim and comment whitespace in lib/pure/random.nim
|
|
|
|
| |
expressions. (#9934)
|
|
|
|
|
|
| |
* fixes #9798
* Change order of write modules
* Move datInit calls ahead of initStackBottom
|
|
|
|
|
|
| |
* Show deprecation warning for fields of a deprecated enum
* Add test
|
|
|
|
|
|
| |
* {.deprecated.} pragma is now supported for enum fields
* Add tests
* Simplify code
|
|
|
|
|
|
|
| |
(#10131)
* fix typetraits.`$` regression https://github.com/c-blake/cligen/issues/84
* add test
|
| |
|
| |
|
|
|
|
|
|
| |
* Move typetraits.`$` to system. Fixes #5827.
* revive PR; adjust code to make sure everything works and add tests
* fix tests/concepts/tstackconcept.nim
* address comments
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#10072)
* Add the ability to sample elements from an openArray according to a parallel
array of weights/unnormalized probabilities (any sort of histogram, basically).
Also add a non-thread safe version for convenience.
* Address Araq comments on https://github.com/nim-lang/Nim/pull/10072
* import at top of file and space after '#'.
* Put in a check for non-zero total weight.
* Clarify constraint on `w`.
* Rename `rand(openArray[T])` to `sample(openArray[T])` to `sample`, deprecating
old name and name new (openArray[T], openArray[U]) variants `sample`.
* Rename caller-provided state version of rand(openArray[T]) and also clean
up doc comments.
* Add test for new non-uniform array sampler. 3 sd bound makes it 99% likely
that it will still pass in the future if the random number generator changes.
We cannot both have a tight bound to check distribution *and* loose check to
ensure resilience to RNG changes. (We cannot *guarantee* resilience, anyway.
There's always a small chance any test hits a legitimate random fluctuation.)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* Copy params which are captured in closures. Fixes #7048
* Forgot to emit a newline; minor adjustments to the test
|
| |
|
| |
|
|
|
|
|
|
| |
* proc does not take untyped/typed as argument
* Add TODO
|
|
|
|
|
| |
* [os] fix #10017 regression
* [os] fix #10025 regression
|
|
|
|
| |
add tests for vmops (#9925)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
compiler/pathutils.nim; added os.relativePath
|
|\
| |
| | |
Pervasive replacement of nkRecWhen in generic types
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Long story short, even if the type contains no reference at all to its
generic parameters we still have to walk its AST and evaluate any
nkRecWhen nodes that semRecordNodeAux skipped due to the type being a
generic one.
We also must be careful to modify the type `n` node in place since it
may be referenced by the caller as seen in the tillegaltyperecursion
test.
Moreover we also can't have the nkSym drift away from their original
values in order not to break the JS nkObjConstr codegen.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #7886.
Fixes #7758.
Fixes #6929.
Fixes #3909.
Replaces #8209.
|
|\ \
| | |
| | | |
Language feature: implement custom pragmas in pragma blocks
|
| | | |
|
| | |
| | |
| | |
| | | |
Fixes #9243
|
| | | |
|
|\ \ \
| | | |
| | | | |
add SinglyLinkedList.append procs
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
refs #9880 show index and bound in lots of `index out of bounds` errors
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|