Skip to content

Commit

Permalink
fix(main): move package direct hook to end of file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sieboldianus committed Feb 6, 2019
1 parent 7a28f91 commit 542e911
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tagmaps/__main__.py
Expand Up @@ -18,7 +18,7 @@
import sys
import time
import logging
from pathlib import Path, PurePath
from pathlib import Path

from tagmaps.classes.cluster import ClusterGen
from tagmaps.classes.compile_output import Compile
Expand All @@ -41,7 +41,7 @@ def main():
cfg = Utils.init_main()

print('\n')
log = logging.getLogger("tagmaps")
log = Utils._set_logger(cfg.output_folder)
log.info(
"########## "
"STEP 1 of 6: Data Cleanup "
Expand Down Expand Up @@ -125,10 +125,6 @@ def main():
sys.exit()


if __name__ == "__main__":
main()


class TagMaps():
"""Perform tag clustering from spatially referenced and tagged records.
Expand Down Expand Up @@ -225,7 +221,11 @@ def __init__(
# create output dir if not exists
Utils._init_output_dir(self.output_folder)
# init logger (logging to console and file log.txt)
self.log = Utils._set_logger(self.output_folder)
tagmaps_logger = logging.getLogger("tagmaps")
if tagmaps_logger:
self.log = tagmaps_logger
else:
self.log = Utils._set_logger(self.output_folder)
# data structures for clustering
self.lbsn_data: PrepareData = None
self.cleaned_post_dict = None
Expand Down Expand Up @@ -438,3 +438,7 @@ def _write_shapes(self, itemized=True):
bounds=self.lbsn_data.bounds,
shapes_and_meta_list=shapelist
)


if __name__ == "__main__":
main()

0 comments on commit 542e911

Please sign in to comment.