Skip to content

Commit

Permalink
Cleanup Imports (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougthor42 authored Nov 6, 2023
1 parent 61c3271 commit c8dbe5f
Show file tree
Hide file tree
Showing 19 changed files with 17 additions and 46 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This document highlights high-level changes made to this program.
+ Added `pre-commit` config.
+ Removed now-unnecessary `build_reqs` directory; moved tests to external package.
+ Formatted code with `black`.
+ Removed `__future__` imports now that we no longer support Python 2; reorder
and fix imports to not use `.` notation. Removed encoding pragma.


## 1.1.2 / 2019-10-14
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# wafer_map documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 1 14:36:48 2017.
Expand All @@ -12,14 +11,14 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.

#
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import logging
import os
import sys
import logging

logging.disable(logging.CRITICAL)

Expand Down
1 change: 0 additions & 1 deletion src/wafer_map/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Plots up a wafer map. Used in semiconductor processing and analysis.
Expand Down
1 change: 0 additions & 1 deletion src/wafer_map/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
__init__ for wafer_map.
Expand Down
2 changes: 0 additions & 2 deletions src/wafer_map/__main__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
"""
Main entry point for wafer_map.
Runs the examples when called with `python -m wafer_map`.
"""

from wafer_map import example

example.main()
5 changes: 1 addition & 4 deletions src/wafer_map/example.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
"""
Provides examples on how to use the ``wafer_map`` package.
This module is called when running ``python -m wafer_map``.
"""
from __future__ import absolute_import, division, print_function, unicode_literals

import wx

from wafer_map import gen_fake_data
from wafer_map import wm_core
from wafer_map import wm_app
from wafer_map import wm_core
from wafer_map.wm_constants import DataType


Expand Down
4 changes: 1 addition & 3 deletions src/wafer_map/gen_fake_data.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
"""
Generate fake data for the wafer_map demo.
Typically not used by anything but the example. It's also a pretty shitty
peice of code so... ye be warned.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import math
import random

from wafer_map import PY2
from wafer_map import wm_constants as wm_const
from wafer_map import wm_info
from wafer_map import wm_utils
from wafer_map import wm_constants as wm_const


# Python2 Compatibility
Expand Down
11 changes: 4 additions & 7 deletions src/wafer_map/wm_app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# -*- coding: utf-8 -*-
"""
A self-contained Window for a Wafer Map.
"""
from __future__ import absolute_import, division, print_function, unicode_literals

import wx

from . import wm_frame
from . import wm_info
from . import gen_fake_data
from . import wm_constants as wm_const
from wafer_map import gen_fake_data
from wafer_map import wm_constants as wm_const
from wafer_map import wm_frame
from wafer_map import wm_info


class WaferMapApp(object):
Expand Down
2 changes: 0 additions & 2 deletions src/wafer_map/wm_constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""
Constants for the wafer_map package.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from enum import Enum

import wx
Expand Down
6 changes: 2 additions & 4 deletions src/wafer_map/wm_core.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
"""
The core of ``wafer_map``.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import math

import numpy as np
import wx
from wx.lib.floatcanvas import FloatCanvas
import wx.lib.colourselect as csel
from wx.lib.floatcanvas import FloatCanvas

from wafer_map import wm_constants as wm_const
from wafer_map import wm_legend
from wafer_map import wm_utils
from wafer_map import wm_constants as wm_const


# Module-level TODO list.
Expand Down
7 changes: 2 additions & 5 deletions src/wafer_map/wm_frame.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# -*- coding: utf-8 -*-
"""
This is the main window of the Wafer Map application.
"""
from __future__ import absolute_import, division, print_function, unicode_literals

import wx

from . import wm_core
from . import wm_constants as wm_const
from wafer_map import wm_constants as wm_const
from wafer_map import wm_core


class WaferMapWindow(wx.Frame):
Expand Down
1 change: 0 additions & 1 deletion src/wafer_map/wm_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
The :class:`wafer_map.wm_info.WaferInfo` class.
"""
Expand Down
6 changes: 2 additions & 4 deletions src/wafer_map/wm_legend.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
"""
Draws the wafer map legend.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import colorsys
from collections import OrderedDict

import wx
from wx.lib.floatcanvas import FloatCanvas
import wx.lib.colourselect as csel
from wx.lib.floatcanvas import FloatCanvas

from wafer_map import PY2
from wafer_map import wm_utils
from wafer_map import wm_constants as wm_const
from wafer_map import wm_utils

# TODO: Update to Bezier Curves for colors. See http://bsou.io/p/3

Expand Down
3 changes: 0 additions & 3 deletions src/wafer_map/wm_utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# -*- coding: utf-8 -*-
"""
Holds various utilities used by ``wafer_map``.
"""
from __future__ import absolute_import, division, print_function, unicode_literals

import numpy as np
from colour import Color

Expand Down
1 change: 0 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Unit tests for wafer_map.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""
Unittests for the :module:`wafer_map.utils` module.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest

from wafer_map import wm_utils as utils
Expand Down
1 change: 0 additions & 1 deletion tests/test_wx_edits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Unittests for the two required changes to wxPython_Phoenix source code.
Expand Down

0 comments on commit c8dbe5f

Please sign in to comment.