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

Unitialized basin_id #142

Closed
christophertubbs opened this issue Aug 18, 2020 · 4 comments · Fixed by #146
Closed

Unitialized basin_id #142

christophertubbs opened this issue Aug 18, 2020 · 4 comments · Fixed by #146
Assignees
Labels
good first issue Good for newcomers

Comments

@christophertubbs
Copy link
Contributor

Forcing.h gets repeated warnings on build because one of the constructors sets basin_id(basin_id), but, since no basin_id is passed, the constructor just sets the basin_id as the value it already was (which wasn't anything).

Would anyone be opposed to me setting that as 0 to ensure that it's at least getting the default value or just taking it out of the signature?

@robertbartel
Copy link
Contributor

@christophertubbs, if long-term it doesn't make sense to allow default basin ids values (i.e., we eventually will need to enforce their explicit inclusion when calling constructors), I lean toward leaving it as-is to remind us there is something there that needs fixing. I wouldn't argue too much though if that got changed regardless.

Given that, I'm fine with either adding a default argument value or an additional constructor, such that this gets initialized to 0.

@hellkite500
Copy link
Member

A quick look shows that basin_id isn't even used anywhere by the forcing object. Essentially, the identity is connected to the input file passed in to be read, and the forcing object is attached to the realization object. There may come a point where we need to pass a larger forcing data set and have a forcing object pull out just the relevant information for a given identity, but if that information doesn't exist, that should be an error condition.

@hellkite500
Copy link
Member

Also, see the TODO here:

//TODO consider passing an ID to the forcing object???

I think we should probably pass the appropriate catchment id (and rename basin_id to catchment_id to be consistent with its use across the realizations)

@jdmattern
Copy link
Contributor

Yes, this is a leftover from the initial prototype. I will submit a PR now with the change to catchment_id.

I will add the 0 as default for now and put a todo for an explicit inclusion as Bobby says.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants