Tools for bleeding/ischaemia risk estimation in PCI patients
Project description
Python Package for Tool/Model Development
This package will contain all the data analysis, model development, and other utilities developed as part of the BHF HBR project.
Package Installation
To install the latest version of the package, run
pip install pyhbr
Dependency versions have not yet been worked out in detail, so you might encounter problems. For now, the dependencies used in the development environment are stored in requirements.txt. (This is a wider set of dependencies than is required for pyhbr, and includes the dependencies for all scripts in this repository.)
Instead of using pip, it is possible to install the package on from this git repository. On Windows, using VS Code, follow these steps:
- Install Python 3 (>= 3.11)
- Create a new virtual environment (
Ctrl-Shift-P, runPython: Create Environment..., pickVenv). Ensure it is activated - Clone this repository and change directory to the
pyhbr/folder. - In the VS Code terminal, install from the requirements file using
pip install -r requirements.txt - To install the package, run
pip install .(If you want to make edits, usepip install -e .)
Development Instructions
Do all installation/development work inside a virtual environment:
- On Linux, create and activate it using
python3 -m venv venvand. venv/bin/activate - On Windows (in VS Code), type Ctrl-Shift-P, run
Python: Create Environment..., pickVenv, and ensure that it is activated (look for something like3.11.4 ('.venv': venv)in the bottom right corner of your screen). It may not activate automatically unless you open a python file in the IDE first.
Currently, dependencies are not yet stored in the package, but the state of the development environment is stored in requirements.txt (generated using pip freeze --all > requirements.txt). To install these dependencies, run:
pip install -r requirements.txt
You can install this package in editable mode (which will make the installation track live edits to this folder) by changing to this folder and running
pip install -e .
You should now be able to run the tests and doctests using:
pytest --doctest-modules
You can generate the documentation for viewing live using:
mkdocs serve
Linux System Dependencies
If you are using Linux, ensure the following packages are installed:
# For PyQt6
sudo apt-get install libxcb-cursor0
Further Development Notes
Ordinarily, running pip install -e . will automatically fetch dependencies from PyPi. However, if you are unable to access PyPI due to networking limitations (on computer A), but are able to move a (~ 250 MiB) file from a computer (B) which does have access to PyPI, then you can perform the steps below to install the dependencies and this package on A.
These instructions were tested on Windows using VS Code virtual environments. Everything should work the same on Linux, except that the Python 3 executable is typically called python3 (when creating virtual environments). Both computers A and B were set up with the same version of Python (3.11.4).
- On
B- Create a new virtual environment using
python -m venv .venv. Activate it in VS code (on Linux, or if you have bash, runsource .venv/bin/activate). - Using any process (manual pip install, pip install from requirements, or automatic installation of dependencies), install all the packages you need in the virtual environment.
- Run
pip freeze --all > requirements.txt - Download all the package wheels into a folder
packagesusingpip download -r requirements.txt -d packages
- Compress the
packagesfolder using any tool; e.g. to producepackages.7z
- Create a new virtual environment using
- Move the
packages.7zfolder, and therequirements.txtfile, fromBtoA - On
A- Extract
packages.7ztopackages - Create a new virtual environment as above
- Install all the dependencies from the
packagesfolder usingpython -m pip install --no-index --find-links packages -r requirements.txt
The--no-indexswitch disables querying PyPI, and--find-linksprovides a path to the wheels. Note the use ofpython -m pip, which will also allow pip to be upgraded.
- Extract
It should now be possible to install the pyhbr package using pip install -e .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhbr-0.0.4.tar.gz.
File metadata
- Download URL: pyhbr-0.0.4.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f55f5beb484d5228378922de75151a6619190661d6fd6fee4388e0b7319d9c21
|
|
| MD5 |
6836bfd4dbc3d0307f1980548ec49744
|
|
| BLAKE2b-256 |
bca9c0fd3b4a1a79a824c09e97a5b48b70617ee95ce96c30772ccd7bf1d3a6ec
|
File details
Details for the file pyhbr-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pyhbr-0.0.4-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d1c34f2d9e3d6d1a269b1b07bb969472dfa5a193e745357377681078044ffc0
|
|
| MD5 |
1ceb7fc7389ec9093920aaf93afed690
|
|
| BLAKE2b-256 |
743db712560adddfe324dd21482c81d463a22340d5c89396d799fd2b35437615
|