-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(lib): stacking pytrees to use scan
- Loading branch information
Showing
10 changed files
with
255 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import matplotlib.pyplot as plt | ||
import typer | ||
|
||
from differt2d.scene import Scene | ||
|
||
|
||
def main(min_order: int = 0, max_order: int = 1, resolution: int = 150): | ||
ax = plt.gca() | ||
scene = Scene.basic_scene() | ||
scene.plot(ax) | ||
|
||
for path in scene.all_paths(): | ||
path.plot(ax) | ||
|
||
X, Y = scene.grid(n=resolution) | ||
|
||
Z = scene.accumulate_on_grid(X, Y, min_order=min_order, max_order=max_order) | ||
|
||
plt.pcolormesh(X, Y, Z) | ||
|
||
plt.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import matplotlib.pyplot as plt | ||
import typer | ||
|
||
from differt2d.scene import Scene | ||
|
||
|
||
def main(resolution: int = 150): | ||
ax = plt.gca() | ||
scene = Scene.square_scene() | ||
scene.plot(ax) | ||
|
||
for path in scene.all_paths(): | ||
path.plot(ax) | ||
|
||
X, Y = scene.grid(n=resolution) | ||
|
||
Z = scene.accumulate_on_grid(X, Y, min_order=1, max_order=1) | ||
|
||
plt.pcolormesh(X, Y, Z) | ||
|
||
plt.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
Oops, something went wrong.