Skip to content

Commit

Permalink
got rid of RadiusParametersContainer class.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmlongLANL committed Feb 22, 2025
1 parent b7b6bf4 commit 4294188
Showing 1 changed file with 4 additions and 35 deletions.
39 changes: 4 additions & 35 deletions src/pleiades/sammy/parameters/radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,34 +238,6 @@ def __repr__(self) -> str:
)


class RadiusParametersContainer:
"""Container for multiple RadiusParameters entries."""

def __init__(self):
self.entries = []

def add_parameters(self, params: RadiusParameters):
"""Add a RadiusParameters entry to the container."""
self.entries.append(params)

def remove_parameters(self, index: int):
"""Remove a RadiusParameters entry from the container by index."""
if 0 <= index < len(self.entries):
self.entries.pop(index)
else:
raise IndexError("Index out of range")

def print_all_parameters(self):
"""Print all RadiusParameters entries in the container."""
for i, params in enumerate(self.entries):
print(f"Entry {i + 1}:")
print(params)
print()

def __repr__(self) -> str:
"""Return a string representation of the container."""
return f"RadiusParametersContainer(entries={self.entries})"

####################################################################################################
# Card variant classes for different formats (default, alternate, keyword)
####################################################################################################
Expand Down Expand Up @@ -298,7 +270,7 @@ def is_header_line(cls, line: str) -> bool:
bool: True if line is a valid header
"""
where_am_i = "RadiusCardDefault.is_header_line()"
logger.debug(f"{where_am_i}: Checking if header line - {line}")
logger.info(f"{where_am_i}: Checking if header line - {line}")
return line.strip().upper().startswith("RADIU")

@staticmethod
Expand Down Expand Up @@ -534,7 +506,7 @@ def is_header_line(cls, line: str) -> bool:
bool: True if line is a valid header
"""
where_am_i = "RadiusCardAlternate.is_header_line()"
logger.debug(f"{where_am_i}: Checking if header line - {line}")
logger.info(f"{where_am_i}: Checking if header line - {line}")
return line.strip().upper().startswith("RADIU")

@staticmethod
Expand Down Expand Up @@ -959,7 +931,7 @@ def is_header_line(cls, line: str) -> bool:

line_upper = line.strip().upper()

logger.debug(f"{where_am_i}: {line_upper}")
logger.info(f"{where_am_i}: {line_upper}")

# Check all valid header formats
valid_headers = [
Expand All @@ -980,7 +952,7 @@ def detect_format(cls, lines: List[str]) -> RadiusFormat:

# Grab header from lines (suppose to be the first line)
header = lines[0].strip().upper()
logger.debug(f"{where_am_i}: Header line: {header}")
logger.info(f"{where_am_i}: Header line: {header}")

# Check for valid header formats
# If KEY-WORD is in the header, it is a keyword format
Expand Down Expand Up @@ -1041,9 +1013,6 @@ def to_lines(self, radius_format: RadiusFormat = RadiusFormat.DEFAULT) -> List[s
where_am_i = "RadiusCard.to_lines()"
logger.info(f"{where_am_i}: Writing radius card in format: {radius_format}")

# Print out the radius parameters
print(f"{where_am_i}: Radius parameters: {self.parameters}")

try:
if radius_format == RadiusFormat.KEYWORD:
lines = [CARD_7A_HEADER]
Expand Down

0 comments on commit 4294188

Please sign in to comment.