Skip to content

TypeError in estimate_alpha_and_beta #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SMSadat98 opened this issue Oct 23, 2022 · 1 comment
Open

TypeError in estimate_alpha_and_beta #80

SMSadat98 opened this issue Oct 23, 2022 · 1 comment

Comments

@SMSadat98
Copy link

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

@hkjeldsberg
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants