Relative imports.
This commit is contained in:
parent
9bce7205d8
commit
cabf12b29e
|
@ -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__)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import requests
|
||||
|
||||
from server.nightr.util import Prediction, Context
|
||||
from ..util import Prediction, Context
|
||||
|
||||
|
||||
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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from server.nightr.util import Context, Prediction
|
||||
from ..util import Context, Prediction
|
||||
|
||||
|
||||
def probability(context: Context) -> Prediction:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user