Skip to content

Instantly share code, notes, and snippets.

Avatar

Henry Schreiner henryiii

View GitHub Profile
View convert_catch2.py
#!/usr/bin/env python3
import sys
import re
import os
testCaseRegex = re.compile(r"TEST\s*\((\w+),\s*(\w+)\)")
testFixtureRegex = re.compile(r"TEST_F\s*\((\w+),\s*(\w+)\)")
expectRegex = re.compile(r"EXPECT_(\w+)\s*\((.*)\);")
assertRegex = re.compile(r"ASSERT_(\w+)\s*\((.*)\);")
@henryiii
henryiii / NextTry.py
Last active Dec 10, 2020
MyPy and Vectors
View NextTry.py
from __future__ import annotations # type: ignore
from typing import Protocol, TypeVar, Generic
T = TypeVar("T")
U = TypeVar("U")
V = TypeVar("V")
W = TypeVar("W")
@henryiii
henryiii / issue.md
Created Jun 4, 2020
pip issue description
View issue.md

Environment

  • pip version: latest
  • Python version: 3.5.4
  • OS: Windows

This happens when using nuget to get Python, and only on Python 3.5. Python 2.7 and 3.6-3.8 are just fine. I have only seen this problem on Windows. This is breaking cibuildwheel, which uses this setup. See https://github.com/joerick/cibuildwheel/pull/358 - there you can see the logs. This may be true with any portable install, I'm not sure.

Description The surrounding environment is used when making a PEP 518 build, rather than the new one created for the build. When building with -v, it is making the environment, but it is not being used.

View 04_runge_kutta.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View treewatch.py
#!/usr/bin/env python3
from argparse import ArgumentParser
from pathlib import Path
from textwrap import indent
import curses
import unicodedata
FOLDER_OPEN = unicodedata.lookup('Open File Folder')
FOLDER_CLOSED = unicodedata.lookup('File Folder')
View CreateData.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pypi_counter.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@henryiii
henryiii / hist.py
Last active Apr 22, 2019 — forked from jpivarski/hist.py
Functional histogram slice proposal
View hist.py
import numbers
import math
import numpy
class Binning:
"Abstract superclass of all binning types. Only Regular is implemented."
def __init__(self, *args, **kwargs):
raise NotImplementedError
@henryiii
henryiii / landau.cpp
Created Nov 17, 2017
Simple example of PyBind11 landau binding
View landau.cpp
// Taken from LCG ROOT MathLib
// License info:
// Authors: Andras Zsenei & Lorenzo Moneta 06/2005
/**********************************************************************
* *
* Copyright (c) 2005 , LCG ROOT MathLib Team *
* *
* *
**********************************************************************/
@henryiii
henryiii / auto-deploy_documentation.md
Last active Feb 15, 2017 — forked from vidavidorra/auto-deploy_documentation.md
Auto-deploying Doxygen documentation to gh-pages with Travis CI
View auto-deploy_documentation.md

Auto-deploying Doxygen documentation to gh-pages with Travis CI

This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages branch using Travis CI. This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.

Sign up for Travis CI and add your project

Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.

Create a clean gh-pages branch

To create a clean gh-pages branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th