Skip to main content

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

Metadata

Release files for bflag 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bflag 0.0.9
File Size Uploaded Provenance Actions
bflag-0.0.9.tar.gz 15.5 kB Without provenance Details for bflag-0.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bflag 0.0.9
File Interpreter ABI Platform Actions
bflag-0.0.9-py3-none-any.whl Python 3 none any Details for bflag-0.0.9-py3-none-any.whl

Total release size: 34.2 kB

Release files / bflag-0.0.9.tar.gz

Download URL bflag-0.0.9.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d5766445ee93f69843a85f8d7d20f0c73b0da1662f0f02c9445c71a7b0b7ba5
BLAKE2b-256 checksum
How to use checksums
9de2cf68c27804438b07d9c9bcf08df6ee5239299161520c1b3348a04235d80e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / bflag-0.0.9-py3-none-any.whl

Download URL bflag-0.0.9-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b86ad2f5c32f38d842d7cbed54183765301a0337f03f560381efb98e54ee44a9
BLAKE2b-256 checksum
How to use checksums
0e09e87d662d9cc5a01258233fa22659cd6d5b5baad19e3974484441b73469ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Security for bflag 0.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page