Skip to content

Commit

Permalink
Merge pull request #2 from sevenstarknight/dev/updates
Browse files Browse the repository at this point in the history
Update all the tests
  • Loading branch information
sevenstarknight authored Jun 20, 2024
2 parents cb34925 + 4881bd0 commit b22f2e3
Show file tree
Hide file tree
Showing 90 changed files with 544 additions and 574 deletions.
26 changes: 26 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"recommendations": [
"mechatroner.rainbow-csv",
"njpwerner.autodocstring",
"aaron-bond.better-comments",
"grapecity.gc-excelviewer",
"mhutchie.git-graph",
"donjayamanne.githistory",
"github.vscode-github-actions",
"ms-python.isort",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy",
"gruntfuggly.todo-tree"

],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
127 changes: 68 additions & 59 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,70 @@
{
"python.defaultInterpreterPath": "./venv/Scripts/python.exe",
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
"python.defaultInterpreterPath": "./venv/Scripts/python.exe",
"python.analysis.extraPaths": ["."],
"python.testing.unittestArgs": [
"-v",
"-t",
".",
"-s",
"./unittests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.terminal.activateEnvironment": true,
"terminal.integrated.env.windows": { "PYTHONPATH": "${workspaceFolder}"},
"better-comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "//",
"color": "#474747",
"strikethrough": true,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "*",
"color": "#98C379",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
}
],
"python.testing.pytestEnabled": false,
"python.linting.pylintEnabled": true,
"python.testing.unittestEnabled": true,
"python.linting.enabled": false,
"better-comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "//",
"color": "#474747",
"strikethrough": true,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "*",
"color": "#98C379",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
}
]
}
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.linting.pylintEnabled": false,
"python.linting.pylintArgs": ["--disable=C0111"],
"python.formatting.provider": "none"
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ Mac: brew install gcc
Windows: consider MSYS2

If using codespaces:
sudo apt-get update
sudo apt-get install gfortran

https://github.com/modflowpy/install-gfortran-action

- Build a virtual environment ([How-To](https://python.plainenglish.io/python-virtual-environments-explained-78d5a040f963)
- Build a virtual environment ([How-To](https://python.plainenglish.io/python-virtual-environments-explained-78d5a040f963))
- in a terminal window: python -m venv venv
- activate the virtual env:
- Linux: `source ./venv/bin/activate`
Expand Down
34 changes: 34 additions & 0 deletions loglevels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from loguru import logger
import sys

class SetLevel():
"""Set the levels for operations
"""
def __init__(self, level:str):
"""LOGURU initialization for set levels
Args:
level (str): what levels?
"""
self.level = level.upper()
if self.validateLogLevel():
self.setLevel()

def setLevel(self):
"""Set the levels
"""
logger.remove() #removes configuration for the default handler "0" is the default ID number
logger.add(sys.stderr, level=self.level) #only records logs with a severity of Warning and greater

def validateLogLevel(self, correct:bool=True) -> bool:
"""Validate the logs
Args:
correct (bool, optional): yes valid. Defaults to True.
Returns:
bool: correct?
"""
if self.level not in ["DEBUG", "TRACE", "INFO", "SUCCESS", "WARNING", "ERROR", "CRITICAL"]:
correct = False
return correct
1 change: 1 addition & 0 deletions src/bindings/models/ionospherestate_class.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# STDLIB modules
from dataclasses import dataclass


Expand Down
1 change: 1 addition & 0 deletions src/bindings/positional/coordinates_class.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# STDLIB modules
import math
from dataclasses import dataclass

Expand Down
3 changes: 3 additions & 0 deletions src/bindings/positional/layer_class.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# STDLIB modules
from dataclasses import dataclass

# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import AER_Coord, ECEF_Coord, LLA_Coord


Expand Down
1 change: 1 addition & 0 deletions src/bindings/positional/satelliteinformation_class.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# STDLIB modules
from dataclasses import dataclass


Expand Down
4 changes: 2 additions & 2 deletions src/bindings/positional/timeandlocation_class.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# STDLIB modules
from dataclasses import dataclass
from datetime import datetime

# ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import LLA_Coord


Expand Down
3 changes: 1 addition & 2 deletions src/bindings/raytracer/interface_class.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import LLA_Coord


Expand Down
3 changes: 2 additions & 1 deletion src/bindings/raytracer/intersection_class.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# STDLIB modules
from dataclasses import dataclass

# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import ECEF_Coord

@dataclass
Expand Down
5 changes: 2 additions & 3 deletions src/bindings/raytracer/raystate_class.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# STDLIB modules
from dataclasses import dataclass

# ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import LLA_Coord


@dataclass
class RayState:
# Class that stores the current state (point) of the ray
Expand Down
4 changes: 2 additions & 2 deletions src/bindings/raytracer/rayvector_class.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# STDLIB modules
from dataclasses import dataclass

# ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import ECEF_Coord
from src.bindings.raytracer.raystate_class import RayState

Expand Down
3 changes: 1 addition & 2 deletions src/bindings/transionosphereeffects_class.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.raytracer.rayvector_class import RayVector


Expand Down
1 change: 1 addition & 0 deletions src/bindings/vector_class.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# THIRDPARTY modules
import numpy as np


Expand Down
9 changes: 4 additions & 5 deletions src/dash_app.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from datetime import datetime

# THIRDPARTY modules
import dash
from dash import html
from dash import dcc
from dash import dash_table
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
import plotly.express as px

from datetime import datetime
## ====================================================
import pandas as pd

## ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.raytracer.raystate_class import RayState
from src.raytracer.raytracer import RayTracer
from src.bindings.positional.coordinates_class import LLA
Expand Down
8 changes: 3 additions & 5 deletions src/endtoenddemonstration.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@

from datetime import datetime

# ====================================================
# local imports
# FIRSTPARTY modules
from src.bindings.models.ionospherestate_class import IonosphereState
from src.bindings.positional.satelliteinformation_class import SatelliteInformation
from src.bindings.positional.timeandlocation_class import TimeAndLocation
from src.indexrefractionmodels.dispersionmodels_enum import DispersionModel
from src.indexrefractionmodels.transportmodes_enum import TransportMode
from src.positional.locationconverter_computations import convertFromECEFtoLLA
from src.positional.locationconverter_computations import LocationConverterComputation
from src.positional.satellitepositiongenerator import SatellitePositionGenerator
from src.raypatheffects import EstimateRayPathEffects
from src.stratification.quantizationparameter_class import QuantizationParameter
Expand All @@ -33,7 +31,7 @@ def __init__(self):

# ======================================================
# expected height, assume minimal change in position with range projection
event_LLA = convertFromECEFtoLLA(ecef=sat_ECEF)
event_LLA = LocationConverterComputation.convertFromECEFtoLLA(ecef=sat_ECEF)
event_LLA.setAltitude(0.0)

self.timeAndLocation = TimeAndLocation(
Expand Down
4 changes: 2 additions & 2 deletions src/indexrefractionmodels/abstract_refraction.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# STDLIB modules
from abc import ABC, abstractmethod

# ====================================================
# local imports
# FIRSTPARTY modules
from src.models.spacephysicsmodels import SpacePhysicsModels
from src.indexrefractionmodels.transportmodes_enum import TransportMode
from src.bindings.positional.layer_class import Layer
Expand Down
1 change: 1 addition & 0 deletions src/indexrefractionmodels/dispersionmodels_enum.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# STDLIB modules
from enum import Enum


Expand Down
5 changes: 2 additions & 3 deletions src/indexrefractionmodels/indexofrefractiongenerator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ====================================================
# local imports

# FIRSTPARTY modules
from src.bindings.positional.coordinates_class import ECEF_Coord
from src.bindings.positional.timeandlocation_class import TimeAndLocation
from src.bindings.models.ionospherestate_class import IonosphereState
Expand All @@ -8,7 +8,6 @@
from src.indexrefractionmodels.xyzmodel import XYZModel
from src.indexrefractionmodels.dispersionmodels_enum import DispersionModel
from src.indexrefractionmodels.transportmodes_enum import TransportMode

from src.models.igrf_model import IGRF_Model
from src.models.iri_model import IRI_Model
from src.models.msise_model import MSISE_Model
Expand Down
1 change: 1 addition & 0 deletions src/indexrefractionmodels/transportmodes_enum.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# STDLIB modules
from enum import Enum


Expand Down
6 changes: 4 additions & 2 deletions src/indexrefractionmodels/xmodel.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# STDLIB modules
import math
from cmath import sqrt

# THIRDPARTY module
from scipy import constants
from loguru import logger

# ====================================================
# local imports
# FIRSTPARTY modules
from src.indexrefractionmodels.abstract_refraction import AbstractIndexRefraction
from src.bindings.positional.layer_class import Layer

Expand Down
Loading

0 comments on commit b22f2e3

Please sign in to comment.