Commit graph

9 commits

Author SHA1 Message Date
Jonathan Wagenet
315605f485 Correct area/volume calculations from intersect with new return type of ShapeList 2025-10-28 23:45:29 -04:00
gumyr
644200f565 Fixed misplaced label for vertical dimension lines Issue #915 2025-05-30 09:12:48 -04:00
Ethan Rooke
8c3f8922a5
fix: avoid date.today() as default arg
Having a function call as a default argument causes the function to be called
once (upon declaration) which leads to confusing behavior. Instead we pass in
`None` and call `date.today()` in the function body.
2024-11-13 21:51:36 -06:00
gumyr
2e81b9d5df Reformatted with black 24.2.0 2024-02-22 11:27:01 -05:00
Ami Fischman
b16f927abc Speed up pytest execution wall time by ~37%.
Before: `644 passed in 19.89s`.
After: `644 passed in 12.47s`.

Running with `python -m pytest --durations=5` showed this test case
was a huge outlier, and timing its execution showed a huge disparity
between the time `TechnicalDrawing` thought it took to run and the
time its caller saw et up. Dropping the Builder context makes these
times lineup.

Tested the individual test case speed-up with `hyperfine -- 'python -m pytest tests/test_drafting.py::TestTechnicalDrawing::test_basic_drawing'`
which reports before & after of:

```
Benchmark 1: python -m pytest tests/test_drafting.py::TestTechnicalDrawing::test_basic_drawing
  Time (mean ± σ):      9.488 s ±  0.534 s    [User: 9.525 s, System: 1.478 s]
  Range (min … max):    9.117 s … 10.929 s    10 runs

Benchmark 1: python -m pytest tests/test_drafting.py::TestTechnicalDrawing::test_basic_drawing
  Time (mean ± σ):      1.951 s ±  0.040 s    [User: 2.292 s, System: 1.111 s]
  Range (min … max):    1.871 s …  2.020 s    10 runs
```

I dug a little into why it was so much slower under the builder and
the answer seems to be ~13k calls to deepcopy, but I haven't dug
deeper yet to figure out if there's a way to "transfer" to the builder
rather than making copies.
2023-11-14 16:48:23 -08:00
gumyr
ea02d7d6e0 Changing compare to account for different fonts 2023-09-18 11:18:03 -04:00
gumyr
ec01c2c9c8 Changing compare to account for different fonts 2023-09-18 11:14:49 -04:00
gumyr
6c042a5b0b Fixed doc strings - prepare for push 2023-09-18 09:54:32 -04:00
gumyr
ec375febd5 Drafting tests pass 2023-09-17 20:31:59 -04:00