Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 2 additions & 38 deletions CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,42 +142,6 @@ it is not necessary to add them to pylinalg.
# Object oriented API conventions

This API is for external use and for novice-users that want to
perform linear algebra operations on conceptually familiar primitives.
perform linear algebra operations.

In this API each "thing" is represented as one object.
This API should make any linalg work much easier and safer, partly
because semantics matters here: a point is not the same as a vector.

These objects are backed by an array-like structure and are thus easy to
convert to native Python/Numpy objects. The objects support native python
operators such as `__mul__` where applicable, and have methods
specific to the type of object.

Extensive input validation and ease of use is prioritized over performance.

The source for this API resides in the `pylinalg.obj` subpackage and is organized
by type.

## Imports cycles

Since the classes here will regularly need to instantiate other types,
circular import dependencies exist. To work around this, only the `LinalgBase`
type can be imported at module level, and other types will have to be imported
at runtime in methods.

## Function naming

* Names should be concise and short.
* For every method, there is an alternative in-place method, signified
with the prefix `i`. This is not the prettiest option, but it is
concise and short.

## Copying and mutability

* By default, methods return new objects, and do not mutate self. Such
methods shall be referred to as "copying methods".
* In-place methods return `self` to enable function chaining.

## Function signatures

* Copying functions accept a `dtype` keyword argument, in-place methods do not.
The source for this API resides in the `pylinalg.obj` subpackagee.
4 changes: 0 additions & 4 deletions pylinalg/obj/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
from .base import *
from .matrix import *
from .quaternion import *
from .vector import *
263 changes: 0 additions & 263 deletions pylinalg/obj/base.py

This file was deleted.

59 changes: 0 additions & 59 deletions pylinalg/obj/matrix.py

This file was deleted.

Loading