Skip to content
Snippets Groups Projects
Commit 7614f487 authored by Arin Wongprommoon's avatar Arin Wongprommoon
Browse files

Absolute imports for modules in routines directory

When the plotting routines in postprocessor.routines are imported in a
different script or module, it raises an error that indicates that
`plottingabc` or `single_plot` are not found.

This is because I attempted to use relative imports without accounting
for how Python usually imports things, especially in a project with
multiple directories and multiple layers.  Relative imports can be done
via:

    from .foo import bar

But I opted against that in favour of absolute imports (the solution
implemented) because it conforms to PEP8.

This should not affect anywhere else in the code base as these are the
only bits where `plottingabc` and `single_plot` are used.
parent 56e4f7dd
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import seaborn as sns
from plottingabc import BasePlotter
from postprocessor.routines.plottingabc import BasePlotter
class _BoxplotPlotter(BasePlotter):
......
......@@ -5,7 +5,7 @@ import matplotlib.pyplot as plt
from matplotlib import cm, colors
from postprocessor.core.processes.standardscaler import standardscaler
from plottingabc import BasePlotter
from postprocessor.routines.plottingabc import BasePlotter
class _HeatmapPlotter(BasePlotter):
......
......@@ -3,7 +3,7 @@
import numpy as np
import matplotlib.pyplot as plt
from plottingabc import BasePlotter
from postprocessor.routines.plottingabc import BasePlotter
class _MeanPlotter(BasePlotter):
......
......@@ -2,7 +2,7 @@
import matplotlib.pyplot as plt
from single_plot import _SinglePlotter
from postprocessor.routines.single_plot import _SinglePlotter
class _SingleBirthPlotter(_SinglePlotter):
......
......@@ -2,7 +2,7 @@
import matplotlib.pyplot as plt
from plottingabc import BasePlotter
from postprocessor.routines.plottingabc import BasePlotter
class _SinglePlotter(BasePlotter):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment