Skip to content
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

getLineProps arguments check #22

Open
kasia129 opened this issue Jun 29, 2024 · 2 comments
Open

getLineProps arguments check #22

kasia129 opened this issue Jun 29, 2024 · 2 comments

Comments

@kasia129
Copy link

Description

On dev branch, in getLineProps function of helpers.py lines 622-665, there is a check for having both the source and lineProps arguments not None, but it is only done after assigning the inputs from the yaml file to the lineProps variable, so the if not lineProps==None statement can never be False.

Current behavior

Warning: both lineProps and source arguments were passed to getLineProps. lineProps will be ignored is always printed out if source is not None, regardless of the lineProps argument.

@mattEhall
Copy link
Collaborator

I think this issue has been fixed in the current state of the dev branch:

if lineProps==None and source==None:

Does updating with the latest commits solve the issue?

@kasia129
Copy link
Author

kasia129 commented Jul 2, 2024

This version still shows the same code, I think. The issue I had in mind was about the if not lineProps==None and not source==None rather than if lineProps==None and source==None. I might be missing something here, but I thought these lines:

if not source==None:
        lineProps = loadLineProps(source)
        if not lineProps==None:
            print('Warning: both lineProps and source arguments were passed to getLineProps. lineProps will be ignored.')

do:

  • check if source is a non-nan argument
  • load mooring properties from source, and assign this dict to lineProps variable
  • check if lineProps variable is not none (i.e., suposedly lineProps argument has also been provided to the function). Because we just set lineProps in the previous step, this statement will never be False?
  • the warning will always be printed out as long as source was provided as an argument.

It could be that loading the moor props from source returns None, but since in loadLineProps() output is initialised as an empty dict, I would think that cannot be the case?

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