Skip to content

Instantly share code, notes, and snippets.

View phaustin's full-sized avatar

Philip Austin phaustin

  • University of British Columbia
  • Vancouver, BC Canada
View GitHub Profile
import trio
WORKER_COUNT = 10
async def worker(receive_chan):
# Trick: each url gets its own clone of the send channel
# After processing a URL, we close its clone
# That way, when all the URLs are done, all the send clones will be
# closed, so the 'async for ... in receive_chan' will automatically exit.
async for send_chan, url in receive_chan:
@phaustin
phaustin / install-conda.yml
Created February 28, 2021 19:11 — forked from aksakalli/install-conda.yml
Installing Minicaonda/Anaconda from Ansible playbook for all
- name: Install Conda
block:
- name: Download Miniconda
get_url:
url: https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh
dest: /tmp/install-miniconda.sh
checksum: md5:a946ea1d0c4a642ddf0c3a26a18bb16d
mode: 0550
- name: Create conda folder
@phaustin
phaustin / conda_tox38.txt
Created September 2, 2020 15:39
py38 jupyter-book tox and docs build
> conda activate dtox38
(dtox38):repos/jupyter-book
> tox -e py38-sphinx3
GLOB sdist-make: C:\Users\Phil\repos\jupyter-book\setup.py
py38-sphinx3 inst-nodeps: C:\Users\Phil\repos\jupyter-book\.tox\.tmp\package\2\jupyter-book-0.8.0.zip
py38-sphinx3 installed: alabaster==0.7.12,altair==4.1.0,apipkg==1.5,appdirs==1.4.4,argon2-cffi==20.1.0,async-generator==1.10,atomicwrites==1.4.0,attrs==20.1.0,Babel==2.8.0,backcall==0.2.0,beautifulsoup4==4.9.1,bleach==3.1.5,bokeh==2.2.1,branca==0.4.1,certifi==2020.6.20,cffi==1.14.2,chardet==3.0.4,click==7.1.2,colorama==0.4.3,coverage==5.2.1,cycler==0.10.0,decorator==4.4.2,defusedxml==0.6.0,docutils==0.16,entrypoints==0.3,execnet==1.7.1,folium==0.11.0,gitdb==4.0.5,GitPython==3.1.7,idna==2.10,imagesize==1.2.0,importlib-metadata==1.7.0,ipykernel==5.3.4,ipython==7.18.1,ipython-genutils==0.2.0,ipywidgets==7.5.1,jedi==0.17.2,Jinja2==2.11.2,jsonschema==3.2.0,jupyter-book @ file:///C:/Users/Phil/repos/jupyter-book/.tox/.tmp/package/2/jupyter-book-0.8.0.zip,jupyter-cache==0.4.1,jupyter-c
@phaustin
phaustin / conda_tox37.txt
Last active September 2, 2020 15:26
py37 jupyter-book tox and docs build
(minitox):Users/Phil
> conda create -n dtox37 python=3.7 tox git pip
(minitox):Users/Phil
> conda activate dtox37
> tox -e py37-sphinx3
GLOB sdist-make: C:\Users\Phil\repos\jupyter-book\setup.py
py37-sphinx3 recreate: C:\Users\Phil\repos\jupyter-book\.tox\py37-sphinx3
py37-sphinx3 installdeps: sphinx>=3,<4
py37-sphinx3 inst: C:\Users\Phil\repos\jupyter-book\.tox\.tmp\package\1\jupyter-book-0.8.0.zip
@phaustin
phaustin / win_py38.txt
Created September 1, 2020 19:02
jupyter_book_win_py38 test
> pytest -vv tests
============================= test session starts =============================
platform win32 -- Python 3.8.5, pytest-3.10.1, py-1.9.0, pluggy-0.13.1 -- c:\users\phil\minjn20\envs\v0.8_3.8\python.exe
cachedir: .pytest_cache
JB TEMPDIR: <TEMP>
rootdir: C:\Users\Phil\repos\jupyter-book, inifile: tox.ini
plugins: cov-2.10.1, datadir-1.3.1, forked-1.3.0, regressions-2.0.1, timeout-1.4.2, xdist-2.1.0
timeout: 100.0s
timeout method: thread
timeout func_only: False
@phaustin
phaustin / v0.8_fail.txt
Last active September 1, 2020 16:39
jb windows doc_build failure
> pytest -vv tests
============================= test session starts =============================
platform win32 -- Python 3.7.8, pytest-3.10.1, py-1.9.0, pluggy-0.13.1 -- c:\users\phil\minjn20\envs\v0.8\python.exe
cachedir: .pytest_cache
JB TEMPDIR: <TEMP>
rootdir: C:\Users\Phil\repos\jupyter-book, inifile: tox.ini
plugins: cov-2.10.1, datadir-1.3.1, forked-1.3.0, regressions-2.0.1, timeout-1.4.2, xdist-2.1.0
timeout: 100.0s
timeout method: thread
timeout func_only: False
@phaustin
phaustin / GitHub-Forking.md
Created May 22, 2020 01:47 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@phaustin
phaustin / chmxdx_letters.py
Created May 19, 2020 01:58 — forked from decentral1se/chmxdx_letters.py
chmxdx_letters.py
from contextlib import asynccontextmanager
from string import ascii_letters
from typing import Dict
import attr
from trio import (
BrokenResourceError,
ClosedResourceError,
Lock,
MemoryReceiveChannel,
@phaustin
phaustin / ec_agenda.md
Created November 20, 2019 19:01
Agenda for EC meeting
  1. explain the new major (and here is Uqam's)

  2. review how we're coping with specialized courses like dynamics/cloud physics/boundary layers (essentially by admitting undergrads to grad courses),

  3. data science

a) committee report

@phaustin
phaustin / marking_guide.md
Last active November 20, 2019 18:22
marking guides from faculty of education