Skip to content

Instantly share code, notes, and snippets.

Moritz E. Beber Midnighter

Block or report user

Report or block Midnighter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Midnighter
Midnighter / test_benchmark_pyparsing.py
Created Aug 18, 2019
Benchmark different unicode-content parsing expressions using pyparsing.
View test_benchmark_pyparsing.py
# Copyright 2011-2019 Moritz Emanuel Beber
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@Midnighter
Midnighter / README.md
Last active Sep 8, 2019
How to make autodoc recognize any Python module.
View README.md

How to Auto Document Your Pytest Test Suite

Triggered by this recent tweet advertising a new pytest plugin that can document itself, I want to briefly describe how you can get sphinx-autodoc to recognize and document the tests.

It is slightly more work since you have to tell Sphinx to auto-document each individual module manually. At least, I haven't yet spent the time to os.walk the test directory and document each one. Assuming the following project

@Midnighter
Midnighter / Pipfile
Created Sep 2, 2018
Perform a single gene deletion study using COBRApy and record the flux distributions.
View Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
cobra = "*"
python-libsbml = "*"
optlang = "*"
pandas = "*"
@Midnighter
Midnighter / Dockerfile
Created Aug 20, 2018
A basic Docker image for running API Star with gunicorn and uvicorn workers on Alpine Linux
View Dockerfile
FROM python:3.6-alpine3.7
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY Pipfile* ./
RUN set -eux \
&& apk add --no-cache --virtual .build-deps build-base \
@Midnighter
Midnighter / Dockerfile
Created Aug 19, 2018
A basic docker image definition for running API Star with gunicorn and uvicorn workers.
View Dockerfile
FROM python:3.6-slim
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /app
WORKDIR /app
COPY Pipfile* ./
@Midnighter
Midnighter / symengine_slots.ipynb
Last active Aug 13, 2018
A Jupyter notebook that explores `__slots__` in symengine 0.3.0
View symengine_slots.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Midnighter
Midnighter / .block
Last active Aug 6, 2018
A prototype for hyper nodes
View .block
license: apache-2.0
height: 500
border: no
@Midnighter
Midnighter / Dockerfile
Last active May 22, 2018
A minimal Python 3.6 Dockerfile intended for microservices that need libc. Sets up an unprivileged user and expects the use of pipenv, gunicorn, and gevent.
View Dockerfile
FROM python:3.6-slim
ENV PYTHONUNBUFFERED=1
ENV APP_USER=giraffe
ARG UID=1000
ARG GID=1000
ARG CWD=/app
@Midnighter
Midnighter / flux_balance.py
Created Aug 24, 2017
Analyze the flux (im-)balance of specific metabolites.
View flux_balance.py
# -*- coding: utf-7 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@Midnighter
Midnighter / orphan_branch.ipynb
Last active Apr 11, 2017
Showing gitpython's problem with orphan branch.
View orphan_branch.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.