Skip to content

Conversation

@dav-og
Copy link
Contributor

@dav-og dav-og commented Nov 2, 2022

…statics.dat locations

@dav-og dav-og requested review from akeeste and salhus November 2, 2022 12:37
Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dav-og

Can you describe the use case here? Typically these files would save to the same directory as the output structure. Also, does this change fit Capytaine's new internal hydrostatics? I haven't run Capytaine since hydrostatics was included, so I'm not sure if that output format has changed at all

@dav-og
Copy link
Contributor Author

dav-og commented Nov 2, 2022

Can you describe the use case here? Typically these files would save to the same directory as the output structure. Also, does this change fit Capytaine's new internal hydrostatics? I haven't run Capytaine since hydrostatics was included, so I'm not sure if that output format has changed at all

Use case is you can have your hydrostatics files saved in a separate location now (if you want to). This is handy for organizing data on a project I'm currently working on that has a lot of floating bodies.

[base_dir, name, ~] = fileparts(filename);

if(~isempty(hydrostatics_sub_dir))
hydrostatics_dir = append(base_dir, hydrostatics_sub_dir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last thought, can you add to the logic here so that user's old BEMIO scripts can function without the hydrostatics_sub_dir argument? Maybe something like if exist('hydrostatics_sub_dir','var') & ~isempty(hydrostatics_sub_dir). I believe that should allow users to not input the directory, but the single '&' should not break the second condition if the variable doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure 👍

@akeeste
Copy link
Contributor

akeeste commented Nov 3, 2022

@dav-og That makes sense, seems like a benefit to allow this for cases with many floating bodies. Last request, can you update the logic to make it backwards compatible with no sub directory input? This will only be an easy work around until other arguments are added to readCapytaine, but might be worthwhile until then

Adam

@akeeste akeeste added Feature new feature request BEM/BEMIO related to BEMIO or BEM hydro data labels Nov 3, 2022
@akeeste
Copy link
Contributor

akeeste commented Nov 3, 2022

Thanks for the update! Approved and I will merge if there's nothing else.

@salhus
Copy link
Contributor

salhus commented Nov 3, 2022

Thanks @akeeste for pointing out the backwards compatibility.
I reviewed this PR yesterday and all looks good.

For the future, I think we could introduce a 'config' argument, that will be a structure for all bemio settings.
Although, the bemio related functions have arguments for changing parameters like time steps etc. it would be much easier to allow user to define fields in a config structure. That way the function call will not change if future parameters for bemio runs are introduced. Also, bemio calls for all BEM software will have the same arguments.

@salhus salhus merged commit 2fe622d into WEC-Sim:dev Nov 3, 2022
@dav-og dav-og self-assigned this Nov 3, 2022
@akeeste
Copy link
Contributor

akeeste commented Nov 3, 2022

@salhus Agreed. I'd like to do this for the plotting functions too. I made a project card for Q2 to address this topic https://github.com/WEC-Sim/WEC-Sim/projects/58#card-86577803

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

Labels

BEM/BEMIO related to BEMIO or BEM hydro data Feature new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants