-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created an install script that would download hapiest and install it'…
…s dependencies, as long as python3 is in the path. There are also two launch scripts that require that python3 is named python
- Loading branch information
Showing
7 changed files
with
85 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# hapiest | ||
*hapiest* is (going to be) a GUI that works with the HITRAN API, enabling access | ||
*hapiest* is a GUI that works with the HITRAN API, enabling access | ||
to all sorts of spectrographic data without knowledge of python. | ||
|
||
# How to Run | ||
|
||
# References | ||
R.V. Kochanov, I.E. Gordon, L.S. Rothman, P. Wcislo, C. Hill, J.S. Wilzewski, HITRAN Application Programming Interface (HAPI): A comprehensive approach to working with spectroscopic data, J. Quant. Spectrosc. Radiat. Transfer 177, 15-30 (2016) [http://www.sciencedirect.com/science/article/pii/S0022407315302466?via%3Dihub]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
|
||
if sys.version_info[0] < 3: | ||
print('You must have Python 3 installed to use hapiest - current version is ' + str(sys.version)) | ||
raw_input('Hit enter to continue') | ||
sys.exit(0) | ||
|
||
REQUIREMENTS = ['PyQt5', 'PyQtChart', 'toml', 'parsy'] | ||
|
||
try: | ||
import PyQt5 | ||
import PyQt5.QtChart | ||
import toml | ||
import parsy | ||
|
||
print('All required packages are already installed!') | ||
except: | ||
import os, pip | ||
|
||
pip_args = ['-vvv'] | ||
if 'http_proxy' in os.environ: | ||
proxy = os.environ['http_proxy'] | ||
pip_args.append('--proxy') | ||
pip_args.append(proxy) | ||
|
||
pip_args.append('install') | ||
for req in REQUIREMENTS: | ||
pip_args.append(req) | ||
print('Installing requirements: ' + str(REQUIREMENTS)) | ||
pip.main(pip_args) | ||
|
||
try: | ||
import PyQt5 | ||
import PyQt5.QtChart | ||
import toml | ||
import parsy | ||
|
||
print('\n\n\n\nSuccessfully installed all missing packages') | ||
except: | ||
print('Failed to install all requirements :(') | ||
print('Try installing the requirements manually') | ||
input('Hit enter to continue') | ||
sys.exit(0) | ||
|
||
finally: | ||
from urllib.request import urlretrieve | ||
|
||
try: | ||
response = urlretrieve('https://github.com/hapiest-team/hapiest/archive/master.zip', 'hapiest.zip') | ||
except Exception as e: | ||
print('Encountered error \'' + str(e) + '\' while trying to download hapiest.') | ||
input('Hit enter to continue') | ||
sys.exit(0) | ||
finally: | ||
import zipfile | ||
|
||
try: | ||
zip = zipfile.ZipFile('hapiest.zip', 'r') | ||
zip.extractall('hapiest') | ||
zip.close() | ||
print('Hapiest has successfully been installed in the directory \'hapiest\'') | ||
except Exception as e: | ||
print('Encountered error \'' + str(e) + '\' when attempting to extract hapiest.zip') | ||
input('Hit enter to continue') | ||
sys.exit(0) | ||
|
||
input('Hit enter to continue') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
python src/__main__.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@echo on | ||
python src/__main__.py | ||
@echo off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters