h5viewer


Nameh5viewer JSON
Version 0.7.5 PyPI version JSON
download
home_pagehttps://github.com/kyrylo-gr/h5viewer
SummaryViewer for hdf5 files created by labmate
upload_time2023-10-15 14:04:50
maintainer
docs_urlNone
authorLKB-OMQ
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements PyQt6 labmate
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![docs/img/main_window.png](./docs/img/main_window.png)

## 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:
```python
# SOURCE: source ~/opt/anaconda3/bin/activate pyqt
```
Example for Windows:
```python
# 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 from `analysis_script.py`. So they could be imported inside `init_analyse.py` like this:
```python
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.

![docs/img/logger.png](./docs/img/logger.png)


### 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`:
```python
aqm.set_init_analyse_file("some_init.py")
```


## Dev

### How to compile locally
Install pyinstaller
```bash
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`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kyrylo-gr/h5viewer",
    "name": "h5viewer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "LKB-OMQ",
    "author_email": "cryo.paris.su@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fc/ec/51d7c8ebbafbda12f9d34940951621d2417030e163ab2b2073331bd4d9f1/h5viewer-0.7.5.tar.gz",
    "platform": null,
    "description": "![docs/img/main_window.png](./docs/img/main_window.png)\n\n## Install\n\n`pip install h5viewer`\n\nor download the `exe` file from the last release.\nIt was tested on mac and windows.\n\n## Usage\nTo open the viewer run `h5viewer` inside your cmd or run the executable file.\n\n### Run analysis\nBy default, analyze code will be executed with `exec`, which means:\n- if you started the window from cmd it'll execute from the same cmd\n- if you started the window as an exe file, it'll execute inside the virtual environment of this exe file, where almost nothing installed\n\nIf 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).\n\nExample for Mac:\n```python\n# SOURCE: source ~/opt/anaconda3/bin/activate pyqt\n```\nExample for Windows:\n```python\n# SOURCE: C:\\ProgramData\\Anaconda3\\Scripts\\activate.bat&&conda activate pyqt\n```\n\n### How to run code before your analyze cell. `init_analyse.py`\nIf 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.\n\nUse case:\nThis is the classical file structure if you use `labmate` library:\n- sample_001\n    - analysis_code\n        - analysis_script.py\n    - data\n        - experiment_1\n            - init_analyse.py\n            - data_file.h5\nSuppose you opened `data_file.h5` and try to run the code inside it, but it needs dependencies from `analysis_script.py`. So they could be imported inside `init_analyse.py` like this:\n```python\nfrom labmate.acquisition_notebook import AcquisitionAnalysisManager\n\nSCRIPT_DIR = os.path.join(os.path.dirname(__file__), os.pardir)\nsys.path.append(os.path.join(os.path.abspath(SCRIPT_DIR), 'analyse'))\n\nmeas_dir = os.path.split(os.path.split(SCRIPT_DIR)[0])[0]\naqm = AcquisitionAnalysisManager(meas_dir)\n\nfrom analysis_script import *\n```\n\n\n### Error\nAny error can be seen in the console view at the bottom right. Output from executing analysis_cell is also available there.\n\n![docs/img/logger.png](./docs/img/logger.png)\n\n\n### Set up `AcquisitionAnalysisManager` to create `init_analyse.py` automatically\nThere is no need for you to create an `init_analyse.py` file in each directory.\n\nYou can set any file to be an `init_analyse.py` by providing it to `AcquisitionAnalysisManager`:\n```python\naqm.set_init_analyse_file(\"some_init.py\")\n```\n\n\n## Dev\n\n### How to compile locally\nInstall pyinstaller\n```bash\npython -m pip install --upgrade pip\npip install setuptools wheel twine\npip install -r requirements.txt\npip install pyinstaller\n```\nThen run\n`pyinstaller main.spec`\nDepending on which system you are, it will create a program file for this system inside the `dist`\n\nNote: there is no need to install the package with pip to compile it.\n\n### Installation in dev mode\n\nYou can download the code, package it and install it in dev mode. It will allow you to change the code while using it.\n\n`python setup.py bdist_wheel && pip install -e .`\n\nor you can just run \n\n`python setup.py develop`\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Viewer for hdf5 files created by labmate",
    "version": "0.7.5",
    "project_urls": {
        "Homepage": "https://github.com/kyrylo-gr/h5viewer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f63c5408bf28279d5efed10d18cfa5f1eea36e009cf5aac175f1c92cd509754",
                "md5": "8d278a11bc4eee892694357501f6c153",
                "sha256": "4ab36b628e065bc5efc6a96e1d766c94a0a46d396d6168a128f3f81b824d1529"
            },
            "downloads": -1,
            "filename": "h5viewer-0.7.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8d278a11bc4eee892694357501f6c153",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12599,
            "upload_time": "2023-10-15T14:04:48",
            "upload_time_iso_8601": "2023-10-15T14:04:48.727276Z",
            "url": "https://files.pythonhosted.org/packages/4f/63/c5408bf28279d5efed10d18cfa5f1eea36e009cf5aac175f1c92cd509754/h5viewer-0.7.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fcec51d7c8ebbafbda12f9d34940951621d2417030e163ab2b2073331bd4d9f1",
                "md5": "02aceec36d3b27874e53c4fda2cce247",
                "sha256": "19444079cf048e1ae60ddb4860e79c288a42fbdb743d97031028909086b5ae38"
            },
            "downloads": -1,
            "filename": "h5viewer-0.7.5.tar.gz",
            "has_sig": false,
            "md5_digest": "02aceec36d3b27874e53c4fda2cce247",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14334,
            "upload_time": "2023-10-15T14:04:50",
            "upload_time_iso_8601": "2023-10-15T14:04:50.284500Z",
            "url": "https://files.pythonhosted.org/packages/fc/ec/51d7c8ebbafbda12f9d34940951621d2417030e163ab2b2073331bd4d9f1/h5viewer-0.7.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-15 14:04:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kyrylo-gr",
    "github_project": "h5viewer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "PyQt6",
            "specs": []
        },
        {
            "name": "labmate",
            "specs": []
        }
    ],
    "lcname": "h5viewer"
}
        
Elapsed time: 0.22879s