Skip to content

Commit

Permalink
use logging instead of print-statements
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnate committed Jan 2, 2025
1 parent 87a9a42 commit 491ff62
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# :copyright (c) URBANopt, Alliance for Sustainable Energy, LLC, and other contributors.
# See also https://github.com/urbanopt/geojson-modelica-translator/blob/develop/LICENSE.md

import logging
from pathlib import Path

from geojson_modelica_translator.model_connectors.model_base import ModelBase
from geojson_modelica_translator.utils import convert_c_to_k

logger = logging.getLogger(__name__)


class LoadBase(ModelBase):
"""Base class of the load connectors."""
Expand Down Expand Up @@ -144,7 +147,7 @@ def add_building(self, urbanopt_building, mapper=None):
year_built = 2015
except KeyError:
year_built = 2015
print(
logger.debug(
f"No year_built found in geojson feature file for building {self.building_id}. "
f"Using default value of {year_built}."
)
Expand All @@ -160,7 +163,7 @@ def add_building(self, urbanopt_building, mapper=None):
"year_built": year_built,
}
except UnboundLocalError:
print(
logger.warning(
f"Geojson feature file is missing data for building {self.building_id}. "
"This may be caused by referencing a detailed osm in the feature file."
)
Expand Down

0 comments on commit 491ff62

Please sign in to comment.