Relative imports.
This commit is contained in:
parent
9bce7205d8
commit
cabf12b29e
|
@ -7,8 +7,8 @@ from typing import List
|
||||||
import requests_cache
|
import requests_cache
|
||||||
from flask import Flask, jsonify
|
from flask import Flask, jsonify
|
||||||
|
|
||||||
from server.nightr.strategies import dmi, steam, miloStrats
|
from .strategies import dmi, steam, miloStrats
|
||||||
from server.nightr.util import Context
|
from .util import Context
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from server.nightr.util import Prediction, Context
|
from ..util import Prediction, Context
|
||||||
|
|
||||||
|
|
||||||
def scrape_traffic(context: Context) -> Prediction:
|
def scrape_traffic(context: Context) -> Prediction:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from server.nightr.util import Context, Prediction
|
from ..util import Context, Prediction
|
||||||
|
|
||||||
|
|
||||||
def probability(context: Context) -> Prediction:
|
def probability(context: Context) -> Prediction:
|
||||||
|
|
|
@ -3,7 +3,7 @@ from datetime import datetime
|
||||||
import cv2
|
import cv2
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
|
||||||
from server.nightr.util import Context, Prediction
|
from ..util import Context, Prediction
|
||||||
|
|
||||||
|
|
||||||
def camImgStrat(context : Context) -> Prediction:
|
def camImgStrat(context : Context) -> Prediction:
|
||||||
|
@ -22,6 +22,7 @@ def camImgStrat(context : Context) -> Prediction:
|
||||||
p.probability = 0.0
|
p.probability = 0.0
|
||||||
return p
|
return p
|
||||||
|
|
||||||
|
|
||||||
def australiaStrat(context : Context) -> Prediction:
|
def australiaStrat(context : Context) -> Prediction:
|
||||||
"""
|
"""
|
||||||
Time in Australia
|
Time in Australia
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
|
import json
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
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():
|
def tmp():
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from server.nightr.util import Context, Prediction
|
from ..util import Context, Prediction
|
||||||
|
|
||||||
|
|
||||||
def probability(context: Context) -> Prediction:
|
def probability(context: Context) -> Prediction:
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
|
import calendar
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import calendar
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from server.nightr.strategies.strat_utils import determine_month
|
from .strat_utils import determine_month
|
||||||
from server.nightr.util import Context, Prediction
|
from ..util import Context, Prediction
|
||||||
|
|
||||||
|
|
||||||
def is_tide(context: Context) -> Prediction:
|
def is_tide(context: Context) -> Prediction:
|
||||||
|
|
|
@ -4,8 +4,8 @@ from typing import List, Dict
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Context:
|
class Context:
|
||||||
battery: float
|
battery: float = 1.0
|
||||||
position: Dict[str, float] # {'latitude': '23.2583', 'longitude': '154.0417'}
|
position: Dict[str, float] = field(default_factory=lambda: {'latitude': 53.0, 'longitude': 9.0})
|
||||||
|
|
||||||
# App settings
|
# App settings
|
||||||
in_australia: bool = False
|
in_australia: bool = False
|
||||||
|
|
Loading…
Reference in a new issue