Skip to content

TypeError in estimate_alpha_and_beta #80

Open

Description

@SMSadat98

Hello @hkjeldsberg ,

while trying to compute alpha/beta values, my arguments were:

default_values["quantity_to_compute"] = "angle"
default_values["region_points"] = []
default_values["value-change"] = 10
default_values["grid-size"] = 25

Set region of interest

default_values["region_of_interest"] = "manual"
default_values["region_points"] = []

Run manipulation

estimate_alpha_and_beta(**default_values)

But I get the error:

Traceback (most recent call last):
File "C:\Users\user\Desktop\morphman_dev2\estimate_curve_angle.py", line 29, in
estimate_alpha_and_beta(**default_values)
TypeError: estimate_alpha_and_beta() got an unexpected keyword argument 'smooth'

Best Regards,
Sadat

Activity

  1. hkjeldsberg commented on Oct 27, 2022

    @hkjeldsberg
    Collaborator

    HI @SMSadat98 ,

    Thanks for reporting this! The error is likely caused by estimate_alpha_and_beta() not following the standard way (in morphman) of fetching the default arguments, thus the default parameter smooth is not required for this method.
    Instead, you can get the default parameters for this particular method by importing them directly in your script. As an example, consider the following script – run_estimate.py:

    from morphman.misc.estimate_alpha_and_beta import read_command_line, estimate_alpha_and_beta
    
    # Get default command line arguments
    default_values = read_command_line()
    
    # Overwrite default arguments
    default_values["region_points"] = []
    default_values["value_change"] = 10
    default_values["grid_size"] = 25
    default_values["region_of_interest"] = "manual"
    default_values["region_points"] = []
    
    # Call method
    estimate_alpha_and_beta(**default_values)
    

    And this can be run with the following command (with angle as the quantity of interest):

    python run_estimate.py --ifile my_model.vtp --quantity angle
    

    Hope this helps!

    Best,
    Henrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions