Relative imports.

This commit is contained in:
Casper V. Kristensen 2019-04-06 15:37:35 +02:00
parent 9bce7205d8
commit cabf12b29e
Signed by: caspervk
GPG key ID: 289CA03790535054
8 changed files with 15 additions and 19 deletions

View file

@ -7,8 +7,8 @@ from typing import List
import requests_cache
from flask import Flask, jsonify
from server.nightr.strategies import dmi, steam, miloStrats
from server.nightr.util import Context
from .strategies import dmi, steam, miloStrats
from .util import Context
app = Flask(__name__)

View file

@ -1,6 +1,6 @@
import requests
from server.nightr.util import Prediction, Context
from ..util import Prediction, Context
def scrape_traffic(context: Context) -> Prediction:

View file

@ -1,4 +1,4 @@
from server.nightr.util import Context, Prediction
from ..util import Context, Prediction
def probability(context: Context) -> Prediction:

View file

@ -3,7 +3,7 @@ from datetime import datetime
import cv2
from pytz import timezone
from server.nightr.util import Context, Prediction
from ..util import Context, Prediction
def camImgStrat(context : Context) -> Prediction:
@ -22,6 +22,7 @@ def camImgStrat(context : Context) -> Prediction:
p.probability = 0.0
return p
def australiaStrat(context : Context) -> Prediction:
"""
Time in Australia

View file

@ -1,13 +1,7 @@
import json
import requests
from bs4 import BeautifulSoup
import pandas as pd
import urllib.request
from datetime import datetime, timedelta
import json
from server.nightr.strategies.strat_utils import determine_month
def tmp():

View file

@ -1,4 +1,4 @@
from server.nightr.util import Context, Prediction
from ..util import Context, Prediction
def probability(context: Context) -> Prediction:

View file

@ -1,10 +1,11 @@
import calendar
import datetime
import json
import calendar
import requests
from server.nightr.strategies.strat_utils import determine_month
from server.nightr.util import Context, Prediction
from .strat_utils import determine_month
from ..util import Context, Prediction
def is_tide(context: Context) -> Prediction:

View file

@ -4,8 +4,8 @@ from typing import List, Dict
@dataclass
class Context:
battery: float
position: Dict[str, float] # {'latitude': '23.2583', 'longitude': '154.0417'}
battery: float = 1.0
position: Dict[str, float] = field(default_factory=lambda: {'latitude': 53.0, 'longitude': 9.0})
# App settings
in_australia: bool = False