Viewer for hdf5 files created by labmate
Project description
Install
pip install h5viewer
or download the exe
file from the last release.
It was tested on mac and windows.
Usage
To open the viewer run h5viewer
inside your cmd or run the executable file.
Run analysis
By default, analyze code will be executed with exec
, which means:
- if you started the window from cmd it'll execute from the same cmd
- if you started the window as an exe file, it'll execute inside the virtual environment of this exe file, where almost nothing installed
If you want to run an analysis inside the specific environment, you should specify it at the beginning of the init_analyse.py
file (which should be in the same directory as your data file).
Example for Mac:
# SOURCE: source ~/opt/anaconda3/bin/activate pyqt
Example for Windows:
# SOURCE: C:\ProgramData\Anaconda3\Scripts\activate.bat&&conda activate pyqt
How to run code before your analyze cell. init_analyse.py
If you want to set up any variables or imports before running the analysis_cell, you can do in by adding the init_analyse.py
file in the same directory as the data file.
Use case:
This is the classical file structure if you use labmate
library:
- sample_001
- analysis_code
- analysis_script.py
- data
- experiment_1
- init_analyse.py
- data_file.h5
Suppose you opened
data_file.h5
and try to run the code inside it, but it needs dependencies fromanalysis_script.py
. So they could be imported insideinit_analyse.py
like this:
- experiment_1
- analysis_code
from labmate.acquisition_notebook import AcquisitionAnalysisManager
SCRIPT_DIR = os.path.join(os.path.dirname(__file__), os.pardir)
sys.path.append(os.path.join(os.path.abspath(SCRIPT_DIR), 'analyse'))
meas_dir = os.path.split(os.path.split(SCRIPT_DIR)[0])[0]
aqm = AcquisitionAnalysisManager(meas_dir)
from analysis_script import *
Error
Any error can be seen in the console view at the bottom right. Output from executing analysis_cell is also available there.
Set up AcquisitionAnalysisManager
to create init_analyse.py
automatically
There is no need for you to create an init_analyse.py
file in each directory.
You can set any file to be an init_analyse.py
by providing it to AcquisitionAnalysisManager
:
aqm.set_init_analyse_file("some_init.py")
Dev
How to compile locally
Install pyinstaller
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install -r requirements.txt
pip install pyinstaller
Then run
pyinstaller main.spec
Depending on which system you are, it will create a program file for this system inside the dist
Note: there is no need to install the package with pip to compile it.
Installation in dev mode
You can download the code, package it and install it in dev mode. It will allow you to change the code while using it.
python setup.py bdist_wheel && pip install -e .
or you can just run
python setup.py develop
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
File details
Details for the file h5viewer-0.7.5.tar.gz
.
File metadata
- Download URL: h5viewer-0.7.5.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19444079cf048e1ae60ddb4860e79c288a42fbdb743d97031028909086b5ae38 |
|
MD5 | 02aceec36d3b27874e53c4fda2cce247 |
|
BLAKE2b-256 | fcec51d7c8ebbafbda12f9d34940951621d2417030e163ab2b2073331bd4d9f1 |
File details
Details for the file h5viewer-0.7.5-py3-none-any.whl
.
File metadata
- Download URL: h5viewer-0.7.5-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab36b628e065bc5efc6a96e1d766c94a0a46d396d6168a128f3f81b824d1529 |
|
MD5 | 8d278a11bc4eee892694357501f6c153 |
|
BLAKE2b-256 | 4f63c5408bf28279d5efed10d18cfa5f1eea36e009cf5aac175f1c92cd509754 |