compas icon indicating copy to clipboard operation
compas copied to clipboard

Fix the doctests

Open tomvanmele opened this issue 2 months ago • 7 comments

What type of change is this?

  • [ ] Bug fix in a backwards-compatible manner.
  • [ ] New feature in a backwards-compatible manner.
  • [ ] Breaking change: bug fix or new feature that involve incompatible API changes.
  • [ ] Other (e.g. doc update, configuration, etc)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [ ] I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • [ ] I ran all tests on my computer and it's all green (i.e. invoke test).
  • [ ] I ran lint on my computer and there are no errors (i.e. invoke lint).
  • [ ] I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [ ] I have added necessary documentation (if appropriate)

tomvanmele avatar Apr 24 '24 22:04 tomvanmele

  • not all objects have __str__
  • having to use print(...) in docstring examples to make sure they don't fail due to precision errors is annoying
  • would be good to have a template structure of some sorts, or at least a few "rules", for docstring examples

other things i have noticed

  • shapes have u and v even when only u makes sense. perhaps that should be changed
  • many attributes could be cached. would be good to have a system for that so that the cache gets invalidated when the parameters of an object are changed (could be a decorator for some attributes linked to an invalidate_cache method)
  • would be useful to further extend the basic infrastructure of with a bounding box attribute
  • point (and vector), line, polyline, polygon, polyhedron share the fact that they are defined explicitly by points. they therefore also don't have a frame. would be good to document this as such.
  • the parametric objects do have a frame, would be good to point this out as well in the docs
  • some intersections are still missing
  • an intersection class that combines all intersection calculations would be useful.
  • in general there should be a rule for binary operations between geometric entities about which entity is "left" and which is "right". for example the lower-dimensional object could always be on the left...

tomvanmele avatar Apr 24 '24 23:04 tomvanmele

@jf--- since i can't add you as reviewer... ping

tomvanmele avatar Apr 24 '24 23:04 tomvanmele

my mouse and keyboard don't want to connect anymore so i will take that as a sign that it is time to give up for today...

tomvanmele avatar Apr 24 '24 23:04 tomvanmele

all are fixed. some had to be skipped because of some weird behaviour, others because of an actual bug. we can do a search for # doctes: +SKIP to investigate in more detail later...

tomvanmele avatar Apr 25 '24 06:04 tomvanmele

the tests are failing because of something weird going on on the github side

tomvanmele avatar Apr 25 '24 06:04 tomvanmele

@tomvanmele this is exciting, is this PR tangential to #1340?

jf--- avatar Apr 27 '24 08:04 jf---

which one do you mean? this one is #1340...

tomvanmele avatar Apr 27 '24 10:04 tomvanmele