Skip to content

Commit

Permalink
Remove unused depth axis type
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Jun 12, 2024
1 parent 13d8be3 commit 6e02dfe
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 44 deletions.
2 changes: 0 additions & 2 deletions src/ert/gui/plottery/plot_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ class PlotContext:
INDEX_AXIS = "INDEX"
COUNT_AXIS = "COUNT"
DENSITY_AXIS = "DENSITY"
DEPTH_AXIS = "DEPTH"
AXIS_TYPES = [
UNKNOWN_AXIS,
COUNT_AXIS,
DATE_AXIS,
DENSITY_AXIS,
DEPTH_AXIS,
INDEX_AXIS,
VALUE_AXIS,
]
Expand Down
17 changes: 0 additions & 17 deletions src/ert/gui/plottery/plot_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class PlotLimits:
index_limits: Tuple[Optional[int], Optional[int]] = (None, None)
count_limits: Tuple[Optional[int], Optional[int]] = (None, None)
density_limits: Tuple[Optional[Num], Optional[Num]] = (None, None)
depth_limits: Tuple[Optional[Num], Optional[Num]] = (None, None)
date_limits: Tuple[Optional[date], Optional[date]] = (None, None)

@property
Expand Down Expand Up @@ -78,22 +77,6 @@ def density_maximum(self) -> Optional[Num]:
def density_maximum(self, value: Optional[Num]) -> None:
self.density_limits = (self.density_limits[0], value)

@property
def depth_minimum(self) -> Optional[Num]:
return self.depth_limits[0]

@depth_minimum.setter
def depth_minimum(self, value: Optional[Num]) -> None:
self.depth_limits = (value, self.depth_limits[1])

@property
def depth_maximum(self) -> Optional[Num]:
return self.depth_limits[1]

@depth_maximum.setter
def depth_maximum(self, value: Optional[Num]) -> None:
self.depth_limits = (self.depth_limits[0], value)

@property
def date_minimum(self) -> Optional[date]:
return self.date_limits[0]
Expand Down
4 changes: 0 additions & 4 deletions src/ert/gui/plottery/plots/plot_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def _getXAxisLimits(plot_context: PlotContext) -> Optional[PlotLimits]:
return limits.date_limits
elif axis_name == plot_context.DENSITY_AXIS:
return limits.density_limits
elif axis_name == plot_context.DEPTH_AXIS:
return limits.depth_limits
elif axis_name == plot_context.INDEX_AXIS:
return limits.index_limits

Expand All @@ -55,8 +53,6 @@ def _getYAxisLimits(plot_context: PlotContext) -> Optional[PlotLimits]:
return limits.date_limits
elif axis_name == plot_context.DENSITY_AXIS:
return limits.density_limits
elif axis_name == plot_context.DEPTH_AXIS:
return limits.depth_limits
elif axis_name == plot_context.INDEX_AXIS:
return limits.index_limits

Expand Down
12 changes: 0 additions & 12 deletions src/ert/gui/tools/plot/customize/limits_customization_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class LimitsStack(StackedInput):
FLOAT_AXIS = [
PlotContext.VALUE_AXIS,
PlotContext.DENSITY_AXIS,
PlotContext.DEPTH_AXIS,
]
INT_AXIS = [PlotContext.INDEX_AXIS, PlotContext.COUNT_AXIS]
NUMBER_AXIS = FLOAT_AXIS + INT_AXIS
Expand All @@ -54,10 +53,6 @@ def __init__(self) -> None:
PlotContext.DENSITY_AXIS,
self.createDoubleLineEdit(minimum=0, placeholder="Default value"),
)
self.addInput(
PlotContext.DEPTH_AXIS,
self.createDoubleLineEdit(minimum=0, placeholder="Default value"),
)
self.addInput(
PlotContext.INDEX_AXIS,
self.createIntegerLineEdit(minimum=0, placeholder="Default value"),
Expand Down Expand Up @@ -169,11 +164,6 @@ def _updateWidgets(self) -> None:
self._y_minimum_stack.setValue(PlotContext.DATE_AXIS, limits.date_minimum)
self._y_maximum_stack.setValue(PlotContext.DATE_AXIS, limits.date_maximum)

self._x_minimum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_minimum)
self._x_maximum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_maximum)
self._y_minimum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_minimum)
self._y_maximum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_maximum)

self._x_minimum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_minimum)
self._x_maximum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_maximum)
self._y_minimum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_minimum)
Expand Down Expand Up @@ -210,8 +200,6 @@ def _updateLimit(self, axis_name, minimum, maximum) -> None:
self._limits.count_limits = minimum, maximum
elif axis_name == PlotContext.DENSITY_AXIS:
self._limits.density_limits = minimum, maximum
elif axis_name == PlotContext.DEPTH_AXIS:
self._limits.depth_limits = minimum, maximum
elif axis_name == PlotContext.DATE_AXIS:
self._limits.date_limits = minimum, maximum
elif axis_name == PlotContext.INDEX_AXIS:
Expand Down
9 changes: 1 addition & 8 deletions tests/unit_tests/gui/plottery/test_plot_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ def test_plot_limits_construction():
assert plot_limits.density_maximum is None
assert plot_limits.density_limits == (None, None)

assert plot_limits.depth_minimum is None
assert plot_limits.depth_maximum is None
assert plot_limits.depth_limits == (None, None)

assert plot_limits.date_minimum is None
assert plot_limits.date_maximum is None
assert plot_limits.date_limits == (None, None)


def test_plot_limits():
plot_limits = PlotLimits()
limit_names = ["value", "index", "count", "density", "depth", "date"]
limit_names = ["value", "index", "count", "density", "date"]

positive_floats = [1.0, 1.5, 3.1415, 1e10, 5.2e-7]
negative_floats = [-1.0, -1.5, -3.1415, -1e10, -5.2e-7]
Expand All @@ -45,7 +41,6 @@ def test_plot_limits():
setter_should_succeed_values = {
"value": positive_floats + negative_floats + positive_ints + negative_ints,
"index": positive_ints,
"depth": positive_floats + positive_ints,
"count": positive_ints,
"density": positive_floats + positive_ints,
"date": dates,
Expand Down Expand Up @@ -81,7 +76,6 @@ def test_copy_plot_limits():
plot_limits.value_limits = 1, 2
plot_limits.index_limits = 3, 4
plot_limits.count_limits = 5, 6
plot_limits.depth_limits = 7, 8
plot_limits.density_limits = 9, 10
plot_limits.date_limits = (
datetime.date(1999, 1, 1),
Expand All @@ -95,7 +89,6 @@ def test_copy_plot_limits():
assert copy_of_plot_limits.value_limits == (1, 2)
assert copy_of_plot_limits.index_limits == (3, 4)
assert copy_of_plot_limits.count_limits == (5, 6)
assert copy_of_plot_limits.depth_limits == (7, 8)
assert copy_of_plot_limits.density_limits == (9, 10)
assert copy_of_plot_limits.date_limits == (
datetime.date(1999, 1, 1),
Expand Down
1 change: 0 additions & 1 deletion tests/unit_tests/gui/plottery/test_plot_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def test_plot_config():

limits = PlotLimits()
limits.count_limits = 1, 2
limits.depth_limits = 3, 4
limits.density_limits = 5, 6
limits.date_limits = datetime.date(2005, 2, 5), datetime.date(2006, 2, 6)
limits.index_limits = 7, 8
Expand Down

0 comments on commit 6e02dfe

Please sign in to comment.