Skip to content

Commit

Permalink
fix: remove kwargs from project
Browse files Browse the repository at this point in the history
  • Loading branch information
AngRodrigues committed Jan 13, 2025
1 parent 04b43f1 commit fc2e393
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions map2loop/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Project(object):
"""
The main entry point into using map2loop
Attiributes
Attributes
-----------
verbose_level: m2l_enums.VerboseLevel
A selection that defines how much console logging is output
Expand Down Expand Up @@ -75,7 +75,6 @@ def __init__(
save_pre_checked_map_data: bool = False,
loop_project_filename: str = "",
overwrite_loopprojectfile: bool = False,
**kwargs,
):
"""
The initialiser for the map2loop project
Expand Down Expand Up @@ -121,17 +120,6 @@ def __init__(
ValueError: use_australian_state_data not in state list ['WA', 'SA', 'QLD', 'NSW', 'TAS', 'VIC', 'ACT', 'NT']
"""

# Throw error if unexpected keyword arguments are passed to project
allowed_kwargs = {"metadata_filename"}
for key in kwargs.keys():
if key not in allowed_kwargs:
logger.error(
f"Unexpected keyword argument '{key}' passed to Project. Allowed keywords: {', '.join(allowed_kwargs)}."
)
raise TypeError(
f"Project got an unexpected keyword argument '{key}' - please double-check this before proceeding with map2loop processing"
)

# make sure all the needed arguments are provided
if not use_australian_state_data: # this check has to skip if using Loop server data
self.validate_required_inputs(
Expand Down Expand Up @@ -170,11 +158,6 @@ def __init__(
self.fold_samples = pandas.DataFrame(columns=["ID", "X", "Y", "Z", "featureId"])
self.geology_samples = pandas.DataFrame(columns=["ID", "X", "Y", "Z", "featureId"])


# Check for alternate config filenames in kwargs
if "metadata_filename" in kwargs and config_filename == "":
config_filename = kwargs["metadata_filename"]

# Sanity check on working projection parameter
if issubclass(type(working_projection), str) or issubclass(type(working_projection), int):
self.map_data.set_working_projection(working_projection)
Expand Down Expand Up @@ -257,8 +240,6 @@ def __init__(
self.stratigraphic_column.populate(self.map_data.get_map_data(Datatype.GEOLOGY))
self.deformation_history.populate(self.map_data.get_map_data(Datatype.FAULT))

if len(kwargs):
logger.warning(f"Unused keyword arguments: {kwargs}")

@beartype.beartype
def validate_required_inputs(
Expand Down

0 comments on commit fc2e393

Please sign in to comment.