From fd8faa9e0798e9863e8e3be9bb9abe5d359dea0c Mon Sep 17 00:00:00 2001
From: Heather Schovanec <hschovanec@usgs.gov>
Date: Thu, 24 Aug 2017 10:26:23 -0600
Subject: [PATCH] Change package and module names

Added the prefix 'imf' to denote intermagnet format.
---
 geomagio/JSON/__init__.py                            |  9 ---------
 .../JSONFactory.py => imfjson/IMFJSONFactory.py}     |  8 +++-----
 .../{JSON/JSONWriter.py => imfjson/IMFJSONWriter.py} |  5 +----
 geomagio/imfjson/__init__.py                         | 12 ++++++++++++
 setup.py                                             |  2 +-
 5 files changed, 17 insertions(+), 19 deletions(-)
 delete mode 100644 geomagio/JSON/__init__.py
 rename geomagio/{JSON/JSONFactory.py => imfjson/IMFJSONFactory.py} (85%)
 rename geomagio/{JSON/JSONWriter.py => imfjson/IMFJSONWriter.py} (98%)
 create mode 100644 geomagio/imfjson/__init__.py

diff --git a/geomagio/JSON/__init__.py b/geomagio/JSON/__init__.py
deleted file mode 100644
index 900950d36..000000000
--- a/geomagio/JSON/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-"""IO Module for JSONFactory Format
-"""
-from __future__ import absolute_import
-
-from .JSONFactory import JSONFactory
-from .JSONWriter import JSONWriter
-
-
-__all__ = ['JSONWriter']
diff --git a/geomagio/JSON/JSONFactory.py b/geomagio/imfjson/IMFJSONFactory.py
similarity index 85%
rename from geomagio/JSON/JSONFactory.py
rename to geomagio/imfjson/IMFJSONFactory.py
index 539cba2c0..21ec634e4 100644
--- a/geomagio/JSON/JSONFactory.py
+++ b/geomagio/imfjson/IMFJSONFactory.py
@@ -1,13 +1,11 @@
 """Factory for json files."""
 from __future__ import absolute_import
 
-import obspy.core
-from .. import ChannelConverter
 from ..TimeseriesFactory import TimeseriesFactory
-from .JSONWriter import JSONWriter
+from .IMFJSONWriter import IMFJSONWriter
 
 
-class JSONFactory(TimeseriesFactory):
+class IMFJSONFactory(TimeseriesFactory):
     """TimeseriesFactory for IAGA 2002 formatted files.
 
     Parameters
@@ -37,4 +35,4 @@ class JSONFactory(TimeseriesFactory):
         channels : array_like
             list of channels to store
         """
-        JSONWriter().write(fh, timeseries, channels)
+        IMFJSONWriter().write(fh, timeseries, channels)
diff --git a/geomagio/JSON/JSONWriter.py b/geomagio/imfjson/IMFJSONWriter.py
similarity index 98%
rename from geomagio/JSON/JSONWriter.py
rename to geomagio/imfjson/IMFJSONWriter.py
index bad681dba..2ea3896cc 100644
--- a/geomagio/JSON/JSONWriter.py
+++ b/geomagio/imfjson/IMFJSONWriter.py
@@ -1,18 +1,15 @@
 from __future__ import absolute_import
-from builtins import range
 
 from io import BytesIO
 from collections import OrderedDict
 from datetime import datetime
 import json
 import numpy as np
-import textwrap
 from .. import ChannelConverter, TimeseriesUtility
 from ..edge import EdgeFactory
 from ..TimeseriesFactoryException import TimeseriesFactoryException
-from ..Util import create_empty_trace
 
-class JSONWriter(object):
+class IMFJSONWriter(object):
     """JSON writer.
     """
 
diff --git a/geomagio/imfjson/__init__.py b/geomagio/imfjson/__init__.py
new file mode 100644
index 000000000..2354d7b14
--- /dev/null
+++ b/geomagio/imfjson/__init__.py
@@ -0,0 +1,12 @@
+"""IO Module for IMFSONFactory Format
+"""
+from __future__ import absolute_import
+
+from .IMFJSONFactory import IMFJSONFactory
+from .IMFJSONWriter import IMFJSONWriter
+
+
+__all__ = [
+    'IMFJSONWriter',
+    'IMFJSONFactory'
+]
diff --git a/setup.py b/setup.py
index c2fc80c0a..fac703c5b 100644
--- a/setup.py
+++ b/setup.py
@@ -11,9 +11,9 @@ setup(
         'geomagio.binlog',
         'geomagio.edge',
         'geomagio.iaga2002',
+        'geomagio.imfjson',
         'geomagio.imfv122',
         'geomagio.imfv283',
-        'geomagio.JSON',
         'geomagio.pcdcp',
         'geomagio.temperature',
         'geomagio.vbf'
-- 
GitLab