Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pilar 2023-01-17 06:34:16 -05:00
commit 5dd3e8c018
2 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,15 @@
import logging as logger import logging as logger
from pathlib import Path from pathlib import Path
import os
log_file = (Path(__file__).parent.parent / 'logs/hub.log').resolve() log_dir = (Path(__file__).parent.parent / 'logs').resolve()
logger.basicConfig(filename=log_file, format="%(asctime)s:%(levelname)s:{%(pathname)s:%(funcName)s:%(lineno)d} " log_file = (log_dir / 'hub.log').resolve()
"- %(message)s", level=logger.DEBUG) try:
if not os.path.isfile(log_file):
os.mkdir(log_dir)
with open(log_file, 'x'):
pass
logger.basicConfig(filename=log_file, format="%(asctime)s:%(levelname)s:{%(pathname)s:%(funcName)s:%(lineno)d} "
"- %(message)s", level=logger.DEBUG)
except IOError as err:
print(f'I/O exception: {err}')

View File

@ -11,6 +11,7 @@ from persistence.db_config import Base
from sqlalchemy.dialects.postgresql import JSONB from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import relationship from sqlalchemy.orm import relationship
import datetime import datetime
import numpy as np
class City(Base): class City(Base):
@ -41,7 +42,9 @@ class City(Base):
self.name = name self.name = name
self.srs_name = srs_name self.srs_name = srs_name
self.country_code = country_code self.country_code = country_code
self.lower_corner = l_corner.tolist() l_corner = l_corner.tolist() if type(l_corner) == np.ndarray else l_corner
self.upper_corner = u_corner.tolist() u_corner = u_corner.tolist() if type(u_corner) == np.ndarray else u_corner
self.lower_corner = l_corner
self.upper_corner = u_corner