pytri

Python wrapper for Substrate

https://github.com/aplbrain/pytri

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 9 committers (11.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary

Keywords

jhuapl jupyter-notebook pytri substrate threejs

Keywords from Contributors

standards interactive serializer cycles packaging network-simulation shellcodes hacking autograding observability
Last synced: 6 months ago · JSON representation

Repository

Python wrapper for Substrate

Basic Info
Statistics
  • Stars: 4
  • Watchers: 5
  • Forks: 2
  • Open Issues: 1
  • Releases: 0
Archived
Topics
jhuapl jupyter-notebook pytri substrate threejs
Created over 8 years ago · Last pushed about 4 years ago
Metadata Files
Readme Changelog

README.md

pytri v2

A Pytri redux, using the latest available THREE.js bindings and GPU-offloaded rendering of large scenes.

WARNING: pytri is currently untested. Use at your own risk.

Installation

```shell pip install pytri

or:

pip3 install git+https://github.com/aplbrain/pytri

```

Getting Started

Let's plot some scatterplot data in 3D. In your favorite Jupyter notebook or binder application, import pytri:

python from pytri import Figure

We can now generate some sample data:

```python import numpy as np

fig = Figure()

xs = np.random.randn(100) ys = np.random.randn(100) zs = np.random.randn(100)

fig.scatter(xs, ys, zs)

fig.show() ```

image

Examples

Render a NetworkX Graph

Here's a crazy dense randomly-arranged graph with over a million edges. (You'll find the slowest part of this process is just generating that graph!)

This graph renders in realtime (60FPS) in Pytri.

```python import networkx as nx g = nx.fastgnprandomgraph(50000, 0.001) pos = {k: [vv * 500 for vv in v] for k, v in nx.random_layout(g, dim=3).items()}

f = Figure() f.axes() f.graph(g, pos=pos, edgewidth=1, nodesize=10)

f.show() ```

image

Random color-changing edges

These edges are a different color on the left edge than on the right edge:

python f = Figure() f.axes() f.lines( # 100 lines on the interval 0-100 np.random.random((100, 2, 3)) * 100, # 200 colors, start/stop for each line colors=np.random.random((100, 2, 3)), width=4 ) f.show()

image

Lines and an image pulled from the internet

python f.imshow( "https://i.imgur.com/VK8Tp5q.jpeg", width=100, height=100, rotation=(0, 3.14/2, 0) ) f.show()

image

Rendering numpy arrays in RGB or Greyscale

python f.scatter(np.random.randint(-50, 50, (1_00_000,3))) f.imshow( # 3 dimensions, interpreted as RGB np.random.random((1000, 1000, 3)), width=200, height=200, rotation=(0, 3.14/2, 0) ) f.imshow( # 2 dimensions, interpreted as grayscale np.random.random((1000, 1000)), width=200, height=200, # omitting rotation, the plane faces "up" along Z )

image

One way to (cheat) render a volume

```python from pytri import Figure import intern

morgan2020 = intern.array("bossdb://morgan2020/lgn/em", resolution=2)

em_excerpt = morgan2020[1000:1050, 25000:25000+300, 25000:25000+300]

coords = [] for z in range(emexcerpt.shape[0]): for y in range(emexcerpt.shape[1]): for x in range(em_excerpt.shape[2]): coords.append((x, y, z*10))

f = Figure() f.scatter(coords, color=[[i,i,i] for i in emexcerpt.ravel()], attenuatesize=True, size=5) f.show() ```

image

Owner

  • Name: APL BRAIN
  • Login: aplbrain
  • Kind: organization

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 112
  • Total Committers: 9
  • Avg Commits per committer: 12.444
  • Development Distribution Score (DDS): 0.563
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jordan Matelsky j****8 49
Jordan Matelsky j****8@g****m 21
Joe Downs j****s@g****m 18
hpcowley h****4@g****m 17
Miller Wilt m****t@g****m 3
Joseph Downs J****s@j****u 1
Raphtor t****r@g****m 1
Ariel Rokem a****m@g****m 1
dependabot[bot] 4****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 44
  • Total pull requests: 56
  • Average time to close issues: 9 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 7
  • Total pull request authors: 7
  • Average comments per issue: 0.98
  • Average comments per pull request: 0.7
  • Merged pull requests: 50
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • j6k4m8 (21)
  • hpcowley (10)
  • jtpdowns (6)
  • mlw214 (3)
  • vinuvargheseijk (2)
  • ndrenkow (1)
  • Raphtor (1)
Pull Request Authors
  • j6k4m8 (19)
  • hpcowley (17)
  • jtpdowns (13)
  • mlw214 (3)
  • Raphtor (2)
  • dependabot[bot] (1)
  • arokem (1)
Top Labels
Issue Labels
enhancement (14) bug (14) good first issue (4) substrate-integration (4) question (3) help wanted (3) jupyter-integration (3) tricky (3) documentation (2) breaking-change (1) wontfix (1)
Pull Request Labels
enhancement (4) do not merge (3) bug (2) jupyter-integration (1) breaking-change (1) dependencies (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 19 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 9
  • Total maintainers: 2
pypi.org: pytri

Pytri, redux

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 19 Last month
Rankings
Dependent packages count: 10.0%
Forks count: 19.1%
Average: 20.4%
Dependent repos count: 21.7%
Stargazers count: 23.1%
Downloads: 28.1%
Maintainers (2)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • networkx *
  • numpy *
  • pythreejs >=2.2.1
  • trimesh *
setup.py pypi
  • numpy *