Skip to content

Commit

Permalink
faster test
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiqwerty committed May 23, 2024
1 parent f794f23 commit df62cf4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,18 @@ from the project's root.
We compare the Rormula to the well-established and way more mature package [Formulaic](https://github.com/matthewwardrop/formulaic).
The [tests](rormula/test/test_wilkinson.py) create a formula in Wilkinson notation and sample 100 random data points. The output on my machine is
```
- test just numerical
Rormula took 0.0020s
Rormula asdf took 0.0247s
Formulaic took 0.2037s
- test numerical and categorical
Rormula took 0.0045s
Rormula asdf took 0.0300s
Formulaic took 0.3403s
- test just numerical 100 rows
Rormula took 0.0009s
Rormula asdf took 0.0213s
Formulaic took 0.1193s
- test numerical and categorical 100 rows
Rormula took 0.0032s
Rormula asdf took 0.0149s
Formulaic took 0.1705s
- test just numerical 100000 rows
Rormula took 0.2240s
Rormula asdf took 0.2895s
Formulaic took 0.2300s
```
For the first and forth lines that start with `Rormula took`, we have separated categorical and numerical data beforehand.
For the result in the second and fifth lines that start with `Rormula asdf took`, we pass and receive pandas dataframes.
Expand All @@ -162,6 +166,7 @@ maturin develop --release --features print_timings
python test/test_wilkinson.py 2> counts.txt
counts -i -e counts.txt
```
see [`rormula/profile.sh`](rormula/profile.sh).
To profile other specific parts of the Rust-code use the `timing!`-macro.
```rust
let res = timing!(some_calculation(), "name of some calculation");
Expand Down
4 changes: 2 additions & 2 deletions rormula/test/test_wilkinson.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ def test_separated():


if __name__ == "__main__":
print("- test just numerical")
print("- test just numerical 100 rows")
test_numerical()
print("- test numerical and categorical")
print("- test numerical and categorical 100 rows")
test_num_cat()
print("- test just numerical 100000 rows")
test_numerical_100000()

0 comments on commit df62cf4

Please sign in to comment.