Skip to content

Commit

Permalink
Merge pull request #22 from RENCI/geo-point-refactor
Browse files Browse the repository at this point in the history
Geo point refactor
  • Loading branch information
PhillipsOwen authored Nov 19, 2024
2 parents d334cbc + 83bc674 commit 828b38c
Show file tree
Hide file tree
Showing 11 changed files with 1,480 additions and 1,251 deletions.
6 changes: 4 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
[MASTER]
init-hook='import sys; sys.path.append("./")'
max-line-length=150
disable=broad-except
disable=broad-except,broad-exception-raised
max-args=16
max-locals=25
min-public-methods=0
max-public-methods=27
fail-under=9.5
extension-pkg-allow-list=pydantic
max-branches=25
max-statements=62
max-positional-arguments=20
max-positional-arguments=20
max-attributes=12
636 changes: 0 additions & 636 deletions src/common/generate_urls_from_times.py

This file was deleted.

13 changes: 9 additions & 4 deletions src/common/geopoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pandas as pd

from src.common.logger import LoggingUtil
import src.common.geopoints_url as gu
from src.common.geopoints_url import GeoPointsURL


class GeoPoint:
Expand All @@ -38,8 +38,11 @@ def __init__(self, _logger=None):
# get the log level and directory from the environment.
log_level, log_path = LoggingUtil.prep_for_logging()

# set the app name
app_name = "APSViz.UI-data.GeoPoint"

# create a logger
self.logger = LoggingUtil.init_logging("APSViz.UI-data.GeoPoint", level=log_level, line_format='medium', log_file_path=log_path)
self.logger = LoggingUtil.init_logging(app_name, level=log_level, line_format='medium', log_file_path=log_path)

def get_geo_point_data(self, **kwargs) -> str:
"""
Expand Down Expand Up @@ -69,8 +72,10 @@ def get_geo_point_data(self, **kwargs) -> str:
args = argsNT(float(kwargs['lon']), float(kwargs['lat']), kwargs['variable_name'], int(kwargs['kmax']), kwargs['alt_urlsource'], tds_svr,
bool(kwargs['keep_headers']), kwargs['ensemble'], int(kwargs['ndays']))

gu = GeoPointsURL(_logger=self.logger)

# call the function, check the return
df_nc = gu.main(args)
df_nc = gu.run(args)

# if there was a valid response
if df_nc is not None:
Expand All @@ -85,7 +90,7 @@ def get_geo_point_data(self, **kwargs) -> str:
tds_svr, bool(kwargs['keep_headers']), None, int(kwargs['ndays']))

# call the function, check the return
df_fc = gu.main(args)
df_fc = gu.run(args)

# if there was a valid response
if df_fc is not None:
Expand Down
Loading

0 comments on commit 828b38c

Please sign in to comment.