NREL / MoorPy

BSD 3-Clause "New" or "Revised" License
31 stars 16 forks source link

Cd_ax moor prop key issue #23

Closed kasia129 closed 5 months ago

kasia129 commented 5 months ago

Description

Trying to use getLineProps() to get moor props from a yaml file, and I think there might be an issue with keys of some properties which are inconsistent between loadLineProps() and getLineProps().

In getLineProps() we look for 'Cd_ax' key in mat, and if it doesn't exist, we assign a default value:

if 'Cd_ax' in mat:
        CdAx = mat['Cd_ax']
    else:
        CdAx = 0.2

even though in the yaml file this key exists, after loading it gets changed to CdAx (no underscore) in getLineProps() by this line: output[mat]['CdAx' ] = getFromDict(props, 'Cd_ax' , default=0.0)

As a result, the value of Cd_Ax is never taken from the yaml file and is always set to default (same for Ca_ax).

mattEhall commented 5 months ago

Thanks for catching this! These inconsistencies should be fixed in a commit I'll push in a minute.

kasia129 commented 5 months ago

Thanks for fixing it, pulled the updated code and can confirm all works fine now.