Skip to content

Instantly share code, notes, and snippets.

View bilderbuchi's full-sized avatar
💭
I may be slow to respond.

Christoph Buchner bilderbuchi

💭
I may be slow to respond.
View GitHub Profile
@bilderbuchi
bilderbuchi / MCP-0027 Proposal update.md
Last active December 15, 2022 10:57
Proposed fix for dealing with literal constants in Modelica unit checking

Update proposal BB2a

This builds on my previous proposal, which was too wide in scope, and drops "empty units" from its scope, to retain the wildcard effect of variables with empty unit string.

In effect, we have to replace "expression containing only literal constants" with "expression containing only literal constants and mathematical operations". This deals with distinguishing between exp(...) and specificEnthalpy(...,...) situations.

This is a minimal-diff change. If agreeable, I propose a behaviour-neutral refactoring below (BB2b) that is a bit larger but makes the structure clearer.

Updated rule 1:

@bilderbuchi
bilderbuchi / failing_doctest.log
Last active October 24, 2020 17:03
Sphinx and pytest problem matchers for Github actions
...
Document: dev/adding_instruments
--------------------------------
**********************************************************************
File "dev/adding_instruments.rst", line 321, in default
Failed example:
extreme.read()
Expected:
'2'
Got:
@bilderbuchi
bilderbuchi / find_redundant_tests.py
Created November 7, 2017 13:57
Identify redundant tests from coverage data
"""Identify redundant tests from coverage data.
STATUS: Rough draft, not working 100% correctly, probably badly documented.
This needs smother (https://github.com/ChrisBeaumont/smother), a tool using coverage,
and offering a pytest plugin, which reports on which source section is covered by which tests.
Usage:
@bilderbuchi
bilderbuchi / check_leftover_pytest_issues.py
Last active October 24, 2017 11:20
Detect pytest PRs whose related issues have not been closed
from github import Github # uses https://github.com/PyGithub/PyGithub
mytoken = '' # insert your GH API token here
g = Github(login_or_token=mytoken)
repo = g.get_repo('pytest-dev/pytest')
candidates = {}
for m in (pr for pr in repo.get_pulls(state='closed') if pr.merged==True):
pr_number = m.number
print('Checking PR {}'.format(pr_number))
issuenr = None
files = m.get_files()
@bilderbuchi
bilderbuchi / coverage_bug_console.log
Last active December 23, 2015 21:29
Coverage bug demonstration. Existing source argument does not make include argument ignored
< this uses https://github.com/bilderbuchi/ofStateManager/tree/5a61f2159fe6d4da6b3a60521e9e62c82b634cae
clone the repo and try it out>
ofStateManager$ cd tests/
ofStateManager/tests$ ./run_coverage.py
============================= test session starts ==============================
platform linux2 -- Python 2.7.4 -- pytest-2.3.5
plugins: cov
collected 34 items
test_archive.py .....
#!/usr/bin/python
import sys
with open(sys.argv[1],'r') as input_file:
print input_file.read()
@bilderbuchi
bilderbuchi / github_tools.py
Last active December 20, 2015 08:19
Issue tracker raw code. not very userfriendly.
"""
A set of small helper functions for interacting with Github repositories
(primarily openFrameworks) via PyGithub.
"""
import webbrowser, os, inspect
from github import Github
def get_repo(user='openframeworks', repo='openFrameworks',
token='Github_token.txt', timeout=20):
@bilderbuchi
bilderbuchi / merge_PRs_since_074.md
Last active December 19, 2015 15:29
Merged PRs since 0.7.4 release
  • Nr 2211 by ofTheo : Bugfix glfw fullscreen fix
  • Nr 2200 by julapy : ios external display mirror mode is now default
  • Nr 2198 by ofTheo : bugfix GLFW delete/backspace/return keys were not coming in. also ctrl-click alt-click were not coming in as left right click. closes #2197
  • Nr 2193 by tgfrerer : Fix rpi compilation issues
  • Nr 2192 by ofTheo : Bugfix glfw fixes - work in progress.
  • Nr 2188 by tgfrerer : rename programmable GL shader attributes
  • Nr 2187 by admsyn : AVFoundation API for iOS Audio Sessions
  • [Nr 2182](https
@bilderbuchi
bilderbuchi / OF-examples-.cproject
Created February 28, 2013 10:31
OF Eclipse allExamples project
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.105645087">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.105645087" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>