Skip to content

Commit

Permalink
Rebase branch onto #200
Browse files Browse the repository at this point in the history
  • Loading branch information
jbednar authored and Azaya89 committed May 23, 2024
1 parent dc9996f commit 5614698
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 610 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ jobs:
rmdir ./tmp
git add ./doc/gallery/$DIR
git commit -m "adding $DIR"
<<<<<<< HEAD
echo "git status"
git status
echo "git push"
git push -u origin HEAD:$BRANCHNAME
=======
git push --force "https://pyviz-developers:${{ secrets.GITHUB_TOKEN }}@github.com/holoviz-topics/examples.git" HEAD:$BRANCHNAME
>>>>>>> 5ee0184f (Rebase branch onto #200)
git checkout local_branch_qpeori
- name: clean up
run: doit clean --clean-dep build:${{ inputs.project }}
Expand Down
18 changes: 18 additions & 0 deletions attractors/.projectignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file contains a list of match patterns that instructs
# anaconda-project to exclude certain files or directories when
# building a project archive. The file format is a simplfied
# version of Git's .gitignore file format. In fact, if the
# project is hosted in a Git repository, these patterns can be
# merged into the .gitignore file and this file removed.
# See the anaconda-project documentation for more details.

# Python caching
*.pyc
*.pyd
*.pyo
__pycache__/

# Jupyter & Spyder stuff
.ipynb_checkpoints/
.Trash-*/
/.spyderproject
12 changes: 6 additions & 6 deletions attractors/attractors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"\n",
"At each time step, the equations define the location for the following time step, and the accumulated locations show the areas of the 2D plane most commonly visited by the imaginary particle. \n",
"\n",
"It's easy to calculate these values in Python using [Numba](http://numba.pydata.org). First, we define the iterative attractor equation:"
"It's easy to calculate these values in Python using [Numba](https://numba.pydata.org). First, we define the iterative attractor equation:"
]
},
{
Expand Down Expand Up @@ -92,7 +92,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can now aggregate these 10,000,000 continuous coordinates into a discrete 2D rectangular grid with [Datashader](http://datashader.org), counting each time a point fell into that grid cell:"
"We can now aggregate these 10,000,000 continuous coordinates into a discrete 2D rectangular grid with [Datashader](https://datashader.org), counting each time a point fell into that grid cell:"
]
},
{
Expand Down Expand Up @@ -247,7 +247,7 @@
"\n",
"## De Jong attractors\n",
"\n",
"A variety of other sets of attractor equations have been proposed, such as these from [Peter de Jong](http://paulbourke.net/fractals/peterdejong):"
"A variety of other sets of attractor equations have been proposed, such as these from [Peter de Jong](https://paulbourke.net/fractals/peterdejong):"
]
},
{
Expand All @@ -270,7 +270,7 @@
"source": [
"## Svensson attractors\n",
"\n",
"From [Johnny Svensson](http://paulbourke.net/fractals/peterdejong/):"
"From [Johnny Svensson](https://paulbourke.net/fractals/peterdejong/):"
]
},
{
Expand All @@ -293,7 +293,7 @@
"source": [
"## Bedhead Attractor\n",
"\n",
"From [Ivan Emrich](https://www.deviantart.com/jaguarfacedman) and [Jason Rampe](https://softologyblog.wordpress.com/2017/03/04/2d-strange-attractors):"
"From [Ivan Emrich and Jason Rampe](https://softologyblog.wordpress.com/2017/03/04/2d-strange-attractors):"
]
},
{
Expand Down Expand Up @@ -375,7 +375,7 @@
"source": [
"## Gumowski-Mira Attractor\n",
"\n",
"From [I. Gumowski and C. Mira](http://kgdawiec.bplaced.net/badania/pdf/cacs_2010.pdf), with code and parameters from [Jason Rampe](https://softologyblog.wordpress.com/2017/03/04/2d-strange-attractors) and [L&aacute;zaro Alonso](https://web.archive.org/web/20220128110321/https://lazarusa.github.io/Webpage/codepython2.html):"
"From [I. Gumowski and C. Mira](https://kgdawiec.bplaced.net/badania/pdf/cacs_2010.pdf), with code and parameters from [Jason Rampe](https://softologyblog.wordpress.com/2017/03/04/2d-strange-attractors) and [L&aacute;zaro Alonso](https://web.archive.org/web/20220128110321/https://lazarusa.github.io/Webpage/codepython2.html):"
]
},
{
Expand Down
18 changes: 14 additions & 4 deletions attractors/attractors_panel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"\n",
"This dashboard code also functions as an example of how to build a Panel application for working with an arbitrarily large family of Python objects organized into a class hierarchy, without depending on the details of that structure and without that code depending on any GUI libraries. In this approach, each object defines its own parameters in a GUI-independent way, but then Panel can access this information and construct appropriate widgets to provide interactive control of the values. This approach can allow the same codebase be used in a GUI with full interactivity while also supporting non-GUI command-line, batch, or headless usage. New classes added to the .py file, even with entirely different parameters, will automatically be supported by this GUI code.\n",
"\n",
"If you aren't familiar with Panel, you may wish to check out the much simpler [Clifford-only app](./clifford_panel.ipynb) first, to understand the basic structure of an app and of how to compute an attractor.\n",
"If you aren't familiar with Panel, you may wish to check out the much simpler [Clifford-only app](clifford_panel.ipynb) first, to understand the basic structure of an app and of how to compute an attractor.\n",
"\n",
"\n",
"## Attractor definitions\n",
Expand Down Expand Up @@ -165,11 +165,21 @@
"from panel.pane import LaTeX\n",
"pn.extension('katex', sizing_mode='stretch_width')\n",
"\n",
"pn.Param.margin = 0\n",
"pn.widgets.Button.param.width.default = 300"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"class Attractors(pn.viewable.Viewer):\n",
" attractor_type = param.Selector(objects=params.attractors, default=params.attractors[\"Clifford\"], precedence=0.9)\n",
"\n",
" parameters = param.Selector(objects=params.attractors, precedence=-0.5, readonly=True)\n",
"\n",
" \n",
" plot_type = param.Selector(\n",
" precedence=0.8, objects=['points', 'line'],\n",
" doc=\"Type of aggregation to use\"\n",
Expand All @@ -180,7 +190,7 @@
"\n",
" @param.depends(\"parameters.param\", watch=True)\n",
" def _update_from_parameters(self):\n",
" a = params.attractor(*self.attractor_type())\n",
" a = params.attractor(*self.parameters)\n",
" if a is not self.attractor_type:\n",
" self.param.update(attractor_type=a)\n",
"\n",
Expand Down Expand Up @@ -236,7 +246,7 @@
"outputs": [],
"source": [
"logo = '<img src=\"https://panel.holoviz.org/_static/logo_stacked.png\" width=180 height=151>'\n",
"text = \"\"\" *This [Panel](https://github.com/holoviz/panel) app lets you explore [strange attractors](attractors.ipynb) \n",
"text = \"\"\" *This [Panel](https://github.com/holoviz/panel) app lets you explore [strange attractors](https://examples.holoviz.org/gallery/attractors/attractors.html) \n",
"-- fractal-like patterns that can emerge from the trajectory of a particle in 2D space.*\n",
"\n",
"*Here you can choose between different attractor families, selecting from predefined examples or \n",
Expand Down
2 changes: 1 addition & 1 deletion attractors/clifford_panel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"src='./assets/clifford_screenshot.png'/>\n",
"\n",
"\n",
"[Clifford attractors](./attractors.py) are a type of iterative equation that traces the path of a particle through a 2D space using functions of sine and cosine terms that make interesting \"attractor\" patterns (covering only some portions of the possible space, in certain shapes). \n",
"[Clifford attractors](attractors.py) are a type of iterative equation that traces the path of a particle through a 2D space using functions of sine and cosine terms that make interesting \"attractor\" patterns (covering only some portions of the possible space, in certain shapes). \n",
"\n",
"Here we use Numpy and Pandas to calculate a dataframe consisting of millions of such locations, using [Numba](https://numba.pydata.org) to make generating them 50X faster than bare Python. We'll then plot the results as a static image using [Datashader](https://datashader.org), which renders arbitrarily large data into fixed-sized images."
]
Expand Down
Loading

0 comments on commit 5614698

Please sign in to comment.