Skip to content

Commit 9eb95fa

Browse files
seismanweiji14
andauthored
Use AbstractBaseClass
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
1 parent 3a4b369 commit 9eb95fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pygmt/params/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"""
44

55

6-
class BaseParam:
6+
from abc import ABC, abstractmethod, abstractproperty
7+
8+
9+
class BaseParam(ABC):
710
"""
811
Base class for parameters in PyGMT.
912
@@ -58,6 +61,7 @@ def __post_init__(self):
5861
"""
5962
self._validate()
6063

64+
@abstractmethod
6165
def _validate(self):
6266
"""
6367
Validate the parameters of the object.
@@ -66,7 +70,7 @@ def _validate(self):
6670
validation on the parameters.
6771
"""
6872

69-
@property
73+
@abstractproperty
7074
def _aliases(self):
7175
"""
7276
List of Alias objects representing the parameters of this class.

0 commit comments

Comments
 (0)