cmtritt 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cmtritt-0.1.0/PKG-INFO +24 -0
- cmtritt-0.1.0/README.md +14 -0
- cmtritt-0.1.0/pyproject.toml +18 -0
- cmtritt-0.1.0/pyproject.toml.orig +21 -0
- cmtritt-0.1.0/src/cmtritt/__init__.py +45 -0
cmtritt-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: cmtritt
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author: Alexander Tritt Monash
|
|
6
|
+
Author-email: Alexander Tritt Monash <alex.tritt@monash.edu>
|
|
7
|
+
Requires-Dist: numpy>=2.5.4
|
|
8
|
+
Requires-Python: >=3.14
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# Tritt colour cycles
|
|
12
|
+
|
|
13
|
+
## Golden
|
|
14
|
+
|
|
15
|
+
Colours are separated in hue by an angle of the golden ratio.
|
|
16
|
+
This means that colours stay well separated when a new colour is added.
|
|
17
|
+
|
|
18
|
+
To apply `matplotlib`:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
import cmtritt
|
|
22
|
+
|
|
23
|
+
cmtritt.apply.golden()
|
|
24
|
+
```
|
cmtritt-0.1.0/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Tritt colour cycles
|
|
2
|
+
|
|
3
|
+
## Golden
|
|
4
|
+
|
|
5
|
+
Colours are separated in hue by an angle of the golden ratio.
|
|
6
|
+
This means that colours stay well separated when a new colour is added.
|
|
7
|
+
|
|
8
|
+
To apply `matplotlib`:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
import cmtritt
|
|
12
|
+
|
|
13
|
+
cmtritt.apply.golden()
|
|
14
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "cmtritt"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.14"
|
|
7
|
+
dependencies = ["numpy>=2.5.4"]
|
|
8
|
+
|
|
9
|
+
[[project.authors]]
|
|
10
|
+
name = "Alexander Tritt Monash"
|
|
11
|
+
email = "alex.tritt@monash.edu"
|
|
12
|
+
|
|
13
|
+
[build-system]
|
|
14
|
+
requires = ["uv_build>=0.12.10,<0.13.0"]
|
|
15
|
+
build-backend = "uv_build"
|
|
16
|
+
|
|
17
|
+
[tool.uv.workspace]
|
|
18
|
+
members = ["."]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "cmtritt"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Alexander Tritt Monash", email = "alex.tritt@monash.edu" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.14"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"numpy>=2.5.4",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[build-system]
|
|
15
|
+
requires = ["uv_build>=0.12.10,<0.13.0"]
|
|
16
|
+
build-backend = "uv_build"
|
|
17
|
+
|
|
18
|
+
[tool.uv.workspace]
|
|
19
|
+
members = [
|
|
20
|
+
".",
|
|
21
|
+
]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import math
|
|
3
|
+
from cycler import cycler
|
|
4
|
+
|
|
5
|
+
_ex = np.array([-1, -1, 2], dtype=float)
|
|
6
|
+
_ey = np.array([1, -1, 0], dtype=float)
|
|
7
|
+
_ez = np.array([1, 1, 1], dtype=float)
|
|
8
|
+
_ex /= np.linalg.norm(_ex)
|
|
9
|
+
_ey /= np.linalg.norm(_ey)
|
|
10
|
+
_ez /= np.linalg.norm(_ez)
|
|
11
|
+
|
|
12
|
+
_phi = (1 + math.sqrt(5))/2
|
|
13
|
+
_psi = (1 - math.sqrt(5))/2
|
|
14
|
+
_r2 = math.sqrt(2)
|
|
15
|
+
_r3 = math.sqrt(3)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class fn:
|
|
19
|
+
@staticmethod
|
|
20
|
+
def golden(index: int):
|
|
21
|
+
theta_0 = 0.6
|
|
22
|
+
theta_2_0 = 0.9
|
|
23
|
+
theta = (-index + 3)*_phi + theta_0
|
|
24
|
+
theta_2 = ((index/7 + 3)*(_psi) + theta_2_0)
|
|
25
|
+
|
|
26
|
+
colour_t = 0.5*np.cos(math.tau*theta)*_ex + 0.5*np.sin(math.tau*theta)*_ey
|
|
27
|
+
# colour = 0.5*_r3*_ez + 0.5/_r2*(np.cos(math.tau*theta_2)**2)*_ez + 0.5*(np.sin(math.tau*theta_2)**2)*colour_t
|
|
28
|
+
# colour = 0.5*_r3*_ez + colour_t
|
|
29
|
+
colour = 0.4*_r3*_ez + 0.15*_r3*(np.sin(math.tau*theta_2))*_ez + 0.5*colour_t*(0.5 + np.cos(math.tau*theta_2)**2)
|
|
30
|
+
# colour *= 0.8
|
|
31
|
+
colour = list(colour)
|
|
32
|
+
# print(colour)
|
|
33
|
+
|
|
34
|
+
return colour
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class cy:
|
|
38
|
+
golden = cycler(color=[fn.golden(index) for index in range(25)])
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class apply:
|
|
42
|
+
@staticmethod
|
|
43
|
+
def golden():
|
|
44
|
+
import matplotlib as mpl
|
|
45
|
+
mpl.rcParams["axes.prop_cycle"] = cy.golden
|