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

warnings for unused parameters in I/O #2239

Open
bob-carpenter opened this issue Mar 5, 2017 · 3 comments
Open

warnings for unused parameters in I/O #2239

bob-carpenter opened this issue Mar 5, 2017 · 3 comments
Assignees
Milestone

Comments

@bob-carpenter
Copy link
Contributor

Summary:

Add a warning for data variables included in a data file that are not used in the model.

Current Version:

v2.14.0

@bob-carpenter bob-carpenter added this to the v3 milestone Mar 5, 2017
@bob-carpenter bob-carpenter self-assigned this Mar 5, 2017
@doikov
Copy link

doikov commented Apr 26, 2017

Do we need to check that the variable is really used in the model, I mean in a strict sense: changing the value of variable leads to changing of the output?

I suppose not, because it sounds too unrealistic to detect that, am I right?

So, If we only need to detect that the model class somehow touch the variable, then the problem looks not so difficult: we can

  1. store an additional flag for every variable name in var_context,
  2. fill this flag on every call var_context.vals_r(name) or var_context.vals_i(name) for particular variable name,
  3. print the warning if some flag is not filled. (Check it in the desctructor of var_context, possibly).

@bob-carpenter
Copy link
Contributor Author

@Doykov --- you're right that it's impossible to check if a variable is really used.

What we want to flag is any variable with a definition in the input file (and in the interfaces in the dictionary, list whatever) is declared as a data variable in the program.

What you're suggesting is the only way I can see to implement it.

This isn't such a high priority issue as we plan to swap out the R dump format in the near future for either JSON or protocol buffers. And most of our users use R or Python anyway. But if you want to tackle it, it'll be useful for at least another year or two!

@sakrejda
Copy link
Contributor

@bob-carpenter I suggested this issue because @Doykov did a GSoC proposal for the protobuf project and part of that is working with var contexts. I agree this isn't a very high priority issue but it's a good excuse for him to muck around in the var_context code.

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

No branches or pull requests

3 participants