Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make get_field_value apply filter by default #18

Open
RichardB9 opened this issue Apr 3, 2018 · 2 comments
Open

Make get_field_value apply filter by default #18

RichardB9 opened this issue Apr 3, 2018 · 2 comments

Comments

@RichardB9
Copy link
Contributor

It can be confusing when accessing data from a specific structure, the filter is not applied by default. For example:

parser.lines.orifices.get_field_value('q') 
parser.lines.orifices.q

I expect the two above lines to return the same values, i.e. all 'q' values of orifices, however the first line returns all 'lines' instead of the subset orifices.
Instead I have to call get_filtered_field_value('q') to get the same result. It seems counter-intuitive to not apply the orifices filter in the above example. This can be confusing for new users.

@larsclaussen
Copy link
Contributor

larsclaussen commented Apr 11, 2018

I agree. To me this seems more like bug. I guess that calling get_field_value() directly bypasses the filter that is defined as a property on the lines object. Maybe the get_field_value() method should be private in the first place. I'll check how the mechanism works to see how we can make field retrievals explicit.

@jpprins1
Copy link
Contributor

Agree, probably the best to remove "get_field_value" and create a function to get a field value from the datasource behind the model.

The "get_filtered_field_value" should be hided, this makes the interface more clear.

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

No branches or pull requests

3 participants