Skip to content

Commit

Permalink
[fix]: Improving docstrings in the data module
Browse files Browse the repository at this point in the history
  • Loading branch information
hentt30 committed May 14, 2021
1 parent 7b290f5 commit 3dd77cf
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 38 deletions.
3 changes: 1 addition & 2 deletions minushalf/data/calculation_code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
List calculation code code
for INP file
List calculation code options for the INP file
"""
from enum import Enum, unique

Expand Down
6 changes: 3 additions & 3 deletions minushalf/data/correction_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Enum type for correction code used
Enum type for correction codes used
in minushalf.yaml
"""
from enum import Enum, unique
Expand All @@ -8,7 +8,7 @@
@unique
class CorrectionCode(Enum):
"""
Enum type for the softwares suport by the program
Enum type for the correction codes
"""

v = "v" # Simple valence correction
Expand All @@ -24,6 +24,6 @@ def __str__(self):
@staticmethod
def to_list():
"""
Generate list of available softwares
Generate list of available correction codes
"""
return list(map(lambda element: element.value, CorrectionCode))
8 changes: 4 additions & 4 deletions minushalf/data/cut_initial_guess_methods.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
List the available methods to derive cut initial guess from the
List the available methods to obtain cut initial guess from the
nearest neighbor distance.
"""
from enum import Enum, unique
Expand All @@ -8,17 +8,17 @@
@unique
class CutInitialGuessMethods(Enum):
"""
Enum type for the methods of derive initial guess.
Enum for different methods of obtaining the initial cut guess.
"""

three_dimensions = "3d" # All electrons
three_dimensions = "3d" # three dimensional crystals

def __str__(self):
return str(self.name)

@staticmethod
def to_list():
"""
Generate list of available calculation codes
Generate list of available methods
"""
return list(map(lambda element: element.value, CutInitialGuessMethods))
3 changes: 1 addition & 2 deletions minushalf/data/electronic_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
@unique
class ElectronicDistribution(Enum):
"""
Enum type for orbital type. Indices are basically the azimuthal quantum
number, l.
Enum type for the electronic distributions of atoms
"""

H = [
Expand Down
7 changes: 3 additions & 4 deletions minushalf/data/exchange_correlation.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""
List exchange correlations code
for INP file
List exchange and correlation codes for the INP file
"""
from enum import Enum, unique


@unique
class ExchangeCorreltion(Enum):
"""
Enum type for the exchange correlations code
Enum type for exchange and correlation codes
"""

ca = "ca" # Ceperley-Alder
Expand All @@ -27,6 +26,6 @@ def __str__(self):
@staticmethod
def to_list():
"""
Generate list of exchange correlation types
Generate list of exchange and correlation codes
"""
return list(map(lambda element: element.value, ExchangeCorreltion))
30 changes: 13 additions & 17 deletions minushalf/data/minushalf_yaml_default_configuration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""
It helds the parameters and the
default values to be used in the
minushalf.yaml file
Lists minushalf.yml parameters and their default values
"""
from enum import Enum, unique
import aenum
Expand All @@ -10,8 +8,7 @@
@unique
class MinushalfParams(Enum):
"""
Parameters that can be
passed in minushalf.yaml
minushalf.yaml parameters.
"""

software = "software"
Expand All @@ -24,15 +21,14 @@ def __str__(self):
@staticmethod
def to_list():
"""
Return a list with params name
that can be passed in minushalf.yaml
Returns a list with the name of the parameters present in minushalf.yaml.
"""
return list(map(lambda element: element.value, MinushalfParams))

@staticmethod
def to_dict():
"""
Returns a dictionary with the parameters
Returns a dictionary with the name of the parameters present in minushalf.yaml.
"""
values = map(lambda element: element.value, MinushalfParams)
keys = map(lambda element: element.__str__(), MinushalfParams)
Expand All @@ -41,7 +37,7 @@ def to_dict():

class CorrectionDefaultParams(aenum.Enum, settings=aenum.NoAlias):
"""
Default params for correction field
Default value of parameters in the correction tag.
"""

correction_code = "v"
Expand All @@ -61,15 +57,15 @@ def __str__(self):
@staticmethod
def to_list():
"""
Return a list with default parameters
Returns a list of default parameters.
"""
return list(map(lambda element: element.value,
CorrectionDefaultParams))

@staticmethod
def to_dict():
"""
Returns a dictionary with the default parameters
Returns a dictionary of default parameters.
"""
values = map(lambda element: element.value, CorrectionDefaultParams)
keys = map(lambda element: element.__str__(), CorrectionDefaultParams)
Expand All @@ -79,7 +75,7 @@ def to_dict():
@unique
class VaspDefaultParams(Enum):
"""
Default params for vasp
Default value of parameters in the vasp tag.
"""

number_of_cores = 1
Expand All @@ -91,14 +87,14 @@ def __str__(self):
@staticmethod
def to_list():
"""
Return a list with default parameters
Returns a list of default parameters.
"""
return list(map(lambda element: element.value, VaspDefaultParams))

@staticmethod
def to_dict():
"""
Returns a dictionary with the default parameters
Returns a dictionary of default parameters.
"""
values = map(lambda element: element.value, VaspDefaultParams)
keys = map(lambda element: element.__str__(), VaspDefaultParams)
Expand All @@ -108,7 +104,7 @@ def to_dict():
@unique
class AtomicProgramDefaultParams(Enum):
"""
Default params for atomic_program
Default value of parameters in the atomic_program tag.
"""

exchange_correlation_code = "pb"
Expand All @@ -121,15 +117,15 @@ def __str__(self):
@staticmethod
def to_list():
"""
Return a list with default parameters
Returns a list of default parameters.
"""
return list(
map(lambda element: element.value, AtomicProgramDefaultParams))

@staticmethod
def to_dict():
"""
Returns a dictionary with the default parameters
Returns a dictionary of default parameters.
"""
values = map(lambda element: element.value, AtomicProgramDefaultParams)
keys = map(lambda element: element.__str__(),
Expand Down
2 changes: 1 addition & 1 deletion minushalf/data/orbital.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __str__(self):
@unique
class Orbital(Enum):
"""
Enum type for specific orbitals. The indices are basically the order in
Enum type for orbitals. The indices are basically the order in
which the orbitals are reported in VASP and has no special meaning.
"""

Expand Down
6 changes: 3 additions & 3 deletions minushalf/data/periodic_table.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Enum class for all the elements
of periodic table
Enum class for all elements
of the periodic table
"""
from enum import Enum, unique


@unique
class PeriodicTable(Enum):
"""Enum representing an element in the periodic table."""
"""Enum type for the elements of the periodic table."""
H = "H"
He = "He"
Li = "Li"
Expand Down
4 changes: 2 additions & 2 deletions minushalf/data/softwares.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
List softwares suported
List softwares supported
by the CLI
"""
from enum import Enum, unique
Expand All @@ -8,7 +8,7 @@
@unique
class Softwares(Enum):
"""
Enum type for the softwares suport by the program
Enum type for the softwares supported by the program
"""

vasp = "VASP"
Expand Down

0 comments on commit 3dd77cf

Please sign in to comment.