___ __ __
/\_ \ __ /\ \ /\ \__
\//\ \ /\_\ __\ \ \___\ \ ,_\ ___ __ __ ___ ___
\ \ \ \/\ \ /'_ `\ \ _ `\ \ \/ /' _ `\/\ \/\ \ /' __` __`\
\_\ \_\ \ \/\ \L\ \ \ \ \ \ \ \_/\ \/\ \ \ \_\ \/\ \/\ \/\ \
/\____\\ \_\ \____ \ \_\ \_\ \__\ \_\ \_\ \____/\ \_\ \_\ \_\
\/____/ \/_/\/___L\ \/_/\/_/\/__/\/_/\/_/\/___/ \/_/\/_/\/_/
/\____/
\_/__/
The idea is to be able to switch (for some functions atleast):
import numpy as np
with import lightnum.lightnum as np
No dependencies, Python >= 3.8 (for testing, numpy, since its compared towards numpy)
python3 -m pip install -e '.[testing, linting]' --user
python3 -m pytest lightnum/test
(After you have installed lightnum with pip
. From your projects root path, run)
python3 /path/to/lightnum/lightnum/scripts/replace_np.py
python3 lightnum/scripts/create_portable.py
Then copy lightnum.py
to your project folder, and use with:
import lightnum
If you plan to put the portable file in a folder like stuff
search for import lightnum
in the newly created lightnum.py
and replace it with import stuff.lightnum
If you want to run the lightnum tests with the portable version, edit the tests and replace import lightnum.lightnum
with the above