si type metric
Project description
bflag
Developer Guide
Setup
# create conda environment
$ mamba env create -f env.yml
# update conda environment
$ mamba env update -n bflag --file env.yml
# $ mamba env update -n bflag --file env.mac.yml
Install
pip install -e .
# install from pypi
pip install bflag
nbdev
# activate conda environment
$ conda activate bflag
# make sure the bflag package is installed in development mode
$ pip install -e .
# make changes under nbs/ directory
# ...
# compile to have changes apply to the bflag package
$ nbdev_prepare
Note: it might be useful to use the following snippet to enable hot reloading:
%load_ext autoreload
%autoreload 2
Publishing
# publish to pypi
$ nbdev_pypi
# publish to conda
$ nbdev_conda --build_args '-c conda-forge'
Usage
Installation
Install latest from the GitHub repository:
$ pip install git+https://github.com/dsm-72/bflag.git
or from conda
$ conda install -c dsm-72 bflag
or from pypi
$ pip install bflag
Examples
(fpos, fneg, fint, fnum, fstr, fzero, fnone)
(fpos(ispos(v)),
fneg(isneg(v)),
fint(isint(v)),
fnum(isnum(v)),
fstr(isstr(v)),
fzero(iszero(v)),
fnone(isnone(v)))
fpos(2), fpos(-2)
(True, False)
values = [-3, -2, -1, 0, 1, 2, 3]
# Using the map method to evaluate all values against a flag
print(fpos.map(values)) # [False, False, False, False, True, True, True]
print(fneg.map(values)) # [True, True, True, False, False, False, False]
# Check if any value satisfies the flag
print(fpos.any(values)) # True
print(fneg.any(values)) # True
# Check if all values satisfy the flag
print(fpos.all(values)) # False
print(fneg.all(values)) # False
[False, False, False, False, True, True, True]
[True, True, True, False, False, False, False]
True
True
False
False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bflag-0.0.9.tar.gz
(15.5 kB
view details)
Built Distribution
bflag-0.0.9-py3-none-any.whl
(18.7 kB
view details)
File details
Details for the file bflag-0.0.9.tar.gz
.
File metadata
- Download URL: bflag-0.0.9.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d5766445ee93f69843a85f8d7d20f0c73b0da1662f0f02c9445c71a7b0b7ba5 |
|
MD5 | eeb3aa6d74b89d505e5eaf26ffa0d9ec |
|
BLAKE2b-256 | 9de2cf68c27804438b07d9c9bcf08df6ee5239299161520c1b3348a04235d80e |
File details
Details for the file bflag-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: bflag-0.0.9-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b86ad2f5c32f38d842d7cbed54183765301a0337f03f560381efb98e54ee44a9 |
|
MD5 | 7363dff59d51cddd355af203406be550 |
|
BLAKE2b-256 | 0e09e87d662d9cc5a01258233fa22659cd6d5b5baad19e3974484441b73469ef |