From 8f3d458af76cc6bbfc855c53998d338c696014af Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Sun, 29 Jan 2023 15:47:16 -0700 Subject: [PATCH] Setup for use with Python virtualenv --- README.md | 31 +++++++++++++++++++++++++++---- requirements.txt | 2 +- witzit-load | 4 ++-- witzit-plot | 4 ++-- witzit-plot2png | 4 ++-- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index daedcc1..904e172 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Perhaps do something like this, or set up a Python virtual environment. ``` sudo apt update -sudo apt install git python3-pip -pip install --user --upgrade pip +sudo apt install git python3-pip python3-virtualenv ``` + ## pysalx The `pysalx` repo contains scripts for interacting with the device. Install that too. @@ -40,11 +40,19 @@ Get source code with `git`. The default `requirements.txt` installs a Tensorflow without GPU support. You can edit the `requirements.txt` file to change which is supported. The "generic" version supports both. +XXX tensorflow not available in pip 2023-01. + +## Setup +Thusly. ``` git clone https://spacecruft.org/spacecruft/witzit cd witzit/ -pip install --user --upgrade -r requirements.txt +virtualenv -p python3 env +source env/bin/activate +pip install --upgrade pip +pip install -r requirements.txt +deactivate ``` @@ -186,6 +194,21 @@ same as in `wut`, so makes a good reference. * https://www.sciencedirect.com/science/article/abs/pii/S1386142521009380 *Feature selection of infrared spectra analysis with convolutional neural network* +# Development +Setup like above, and also: + +``` +cd witzit/ +source env/bin/activate +pip install -r requirements-dev.txt +``` + +Then before committing new code, make sure it is enprettified: + +``` +black foo.py +``` + # See Also @@ -214,5 +237,5 @@ Unofficial, unaffiliated with SciAps or Olympus. # License License: GPLv3 or any later version. -Copyright (C) 2019-2022, Jeff Moe +*Copyright © 2019-2023, Jeff Moe.* diff --git a/requirements.txt b/requirements.txt index 767cb55..773f99a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ pandas seaborn sklearn -tensorflow_cpu +#tensorflow_cpu #tensorflow_gpu==2.7.0 #tensorflow==2.7.0 diff --git a/witzit-load b/witzit-load index b182083..50dd246 100755 --- a/witzit-load +++ b/witzit-load @@ -1,8 +1,8 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # witzit-load # -# Copyright (C) 2022, Jeff Moe +# Copyright (C) 2022, 2023, Jeff Moe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/witzit-plot b/witzit-plot index 7957345..7b02b5a 100755 --- a/witzit-plot +++ b/witzit-plot @@ -1,8 +1,8 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # witzit-plot # -# Copyright (C) 2022, Jeff Moe +# Copyright (C) 2022, 2023, Jeff Moe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/witzit-plot2png b/witzit-plot2png index 553e997..246bbb4 100755 --- a/witzit-plot2png +++ b/witzit-plot2png @@ -1,8 +1,8 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # witzit-plot2png # -# Copyright (C) 2022, Jeff Moe +# Copyright (C) 2022, 2023 Jeff Moe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by