This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.fixture(name="keys") | |
def keys_fixture(request): | |
"""A seq of keys""" | |
return request.param | |
@pytest.fixture(name="values") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Tools for parsing the format specification mini language used by the ``format`` built-in function. | |
See the string module docs for more information. | |
The mini language parsing functionality is not exposed in cPython and has therefore been re-implemented | |
here.''' | |
from collections import namedtuple as nt | |
import re | |
# only mini-language types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Utility module for checking internal equality of Collections and efficiently getting back an iterator.""" | |
import itertools | |
from typing import NamedTuple, TypeVar, Iterator, Collection, Union | |
T = TypeVar("T") | |
class _NotEqual: | |
def __repr__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Proof of concept for an API providing "English-like" function calls. | |
See original python-ideas [thread](https://mail.python.org/archives/list/[email protected]/thread/YMFRX6K22TZNNAP2PPVV7RGNI5HLC764/#WF232SOAJJWM33ZAY327OAPCONFOUXVX). | |
API: | |
``` | |
from curry_helper import curry_helper | |
# apply the curry_helper decorator with a list of function "suffixes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""API for implemenating the concept of civil engineering load combinations. | |
Compose a string representing a load combination expression: | |
>>> expr = "1.6*D & 1.2*L & 0.5*(S | Lr | W)" | |
Create a `Combination` object using the load combination expression, and generate a multiplication matrix: | |
>>> from ceng.load import Combination | |
>>> combo_obj = Combination(expr) | |
>>> combo_obj.matrix | |
array([[1.6, 1.2, 0.5, 0. , 0. ], |