Skip to main content

An all-in-one toolkit package to easy my Python work in my PhD.

Project description

PyhDToolkit: An all-in-one toolkit package for Python work in my PhD.

This repository is a package gathering a number of Python utilities for my work.

Installation

This code is compatible with Python 3.6+. If for some reason you have a need for it, you should first install the prerequisites with:

make pipreq

Then, you can simply install it with:

pip install --editable git+https://github.com/fsoubelet/PyhDToolkit.git@master#egg=pyhdtoolkit

The --editable flag should only be included if you intend to make some hotfix changes to the site-package. If you intend on making actual changes, then you should clone this repository through VCS, and install it into a virtual environment. With git, this would be:

git clone https://github.com/fsoubelet/PyhDToolkit.git
cd PyhDToolkit
make

Testing

Tests are currently a work in progress. Testing builds are ensured after each commit through Travis-CI.

You can run tests locally with:

make tests

Standards, Tools and VCS

This repository respects the PyCharm docstring format, uses Black as a code formatter with a default enforced line length of 120 characters, and Pylint as a linter. You can format the code with:

make black

You can lint the code with:

make lint

VCS is done through git and follows the Gitflow workflow. As a consequence, make sure to always install from master.

Miscellaneous

Feel free to explore the Makefile and make use of the functions it offers. You will get an idea of what functionality is available to you by running:

make help

Environment

This repository currently comes with an environment.yml file to reproduce a fully compatible conda environment. You can install this environment and add it to your ipython kernel by running:

make condaenv

Container

A Dockerfile is included if you want to build a container image from source. You can do so, building with the tag simenv, with the command:

make docker-build

Alternatively, you can directly pull a pre-built image from Dockerhub with:

make docker-pull

You can then run your container in interactive mode, and use the already activated conda environment for your work. It is highly advised to run with --init for zombie processes protection, see Tini for details. Assuming you pulled the provided image from Dockerhub, the command is then:

docker run -it --rm --init fsoubelet/simenv

If you want to do some exploration through a jupyter interface then you need to tell your container to install it first, as it is not bundled in miniconda, then add the custom environment kernelspec. The following command will take care of all this:

docker run -it --rm --init -p 8888:8888 fsoubelet/simenv /bin/bash -c "/opt/conda/bin/conda install -c conda-forge jupyterlab -y --quiet > /dev/null && mkdir /opt/notebooks && /opt/conda/envs/PHD/bin/ipython kernel install --user --name=PHD && /opt/conda/bin/jupyter lab --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root"

You can then copy the provided token and head to localhost:8888 on your local machine.

License

Copyright © 2019-2020 Felix Soubelet. MIT License

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

pyhdtoolkit-0.2.0.tar.gz (36.1 kB view details)

Uploaded Source

File details

Details for the file pyhdtoolkit-0.2.0.tar.gz.

File metadata

  • Download URL: pyhdtoolkit-0.2.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200209 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for pyhdtoolkit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9559c20b2a96d1fd3cf3c20222c7242b13bf126bf1d4617b9045dc7b21027f77
MD5 4eefeeffc1a25467bc0c1da19b9167a5
BLAKE2b-256 f348651ff909ddf8733318b9a7912e8e4df8558636c4d8584b2843f0b6acc49d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page