Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Cooper committed Jul 12, 2023
1 parent b1fc32d commit 476ca4e
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: wget -O SIMPLE.db https://raw.githubusercontent.com/SIMPLE-AstroDB/SIMPLE-binary/main/SIMPLE.db && python simple_app/app_simple.py -p $PORT -i '0.0.0.0' -f 'SIMPLE.db'
web: wget -O SIMPLE.db https://raw.githubusercontent.com/SIMPLE-AstroDB/SIMPLE-binary/main/SIMPLE.db && python simple_app.app_simple -p $PORT -i '0.0.0.0' -f 'SIMPLE.db'
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ wget https://raw.githubusercontent.com/SIMPLE-AstroDB/SIMPLE-binary/main/SIMPLE.

### Running
Then run the application with
```python
python simple_app/app_simple.py
```bash
python -m simple_app.app_simple
```
For more options (help) run
```python
python simple_app/app_simple.py -h
```bash
python -m simple_app.app_simple -h
```
Launch a browser and enter the URL [http://127.0.0.1:8000](http://127.0.0.1:8000).
If you have changed either the host or port with system arguments, use those instead.
Expand Down
3 changes: 0 additions & 3 deletions simple_app.wsgi
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#/usr/bin/python
import sys
sys.path.insert(0, "simple_root/simple_app")
sys.path.insert(0, "simple_root")
from simple_app import create_app
application = create_app()
2 changes: 1 addition & 1 deletion simple_app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def create_app():
# initialise
from app_simple import app_simple
from .app_simple import app_simple
return app_simple
5 changes: 1 addition & 4 deletions simple_app/app_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
This is the main script to be run from the directory root, it will start the Flask application running which one can
then connect to.
"""
import sys
sys.path.append('simple_root/simple_app')
# local packages
from plots import *
from utils import *
from .plots import *

# initialise
app_simple = Flask(__name__) # start flask app
Expand Down
5 changes: 1 addition & 4 deletions simple_app/plots.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"""
File containing the 'workhorse' functions generating the various plots seen on the website
"""
import sys
sys.path.append('simple_root/simple_app')

# local packages
from utils import *
from .utils import *

# feature labels taken from splat
FEATURE_LABELS = {
Expand Down
6 changes: 2 additions & 4 deletions simple_app/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
Testing the plot functions
"""
# local packages
import sys
sys.path.append('simple_app')
from plots import *
from tests.test_utils import *
from ..plots import *
from .test_utils import *


@pytest.fixture(scope='session')
Expand Down
4 changes: 1 addition & 3 deletions simple_app/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
absmags -- called by results_concat
coordinate_project -- called by results_concat
"""
import sys
sys.path.append('simple_app')
# local packages
from utils import *
from ..utils import *

db_name = 'simple_root/temp.db'
db_cs = f'sqlite:///{db_name}'
Expand Down
5 changes: 1 addition & 4 deletions simple_app/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""
The static functions for various calculations and required parameters
"""
import sys

sys.path.append('simple_root/simple_app')
from simports import *
from .simports import *


def sysargs():
Expand Down
1 change: 0 additions & 1 deletion simple_root

This file was deleted.

0 comments on commit 476ca4e

Please sign in to comment.