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

Param parse #25

Merged
merged 7 commits into from
Feb 9, 2016
Merged

Param parse #25

merged 7 commits into from
Feb 9, 2016

Conversation

alexcjohnson
Copy link
Contributor

@AdriaanRol @MarkusJacobsen Some more parsing options for Parameters:

  • separate functions for parsing both ways: set_parser to transform the input value, and get_parser to transform the instrument response (replaces parse_function)
  • for symmetry, I also added this to Function, where I called them parameter_parser and return_parser because it's not really set and get there.
  • an even shorter, cleaner mechanism, val_mapping for cases where there are a fixed set of possible values that need to be passed to the instrument in coded form - a single dictionary takes care of translating for both set and get, as well as generating the correct Validator

parse_function still works but is marked deprecated - I'll take out existing parse_function instances and the compatibility code in a later PR - after this PR is merged and you've had a chance to merge master into any branches you're working on - so the change doesn't conflict with things you are doing now.

param_count=self._param_count,
cmd=call_cmd, acmd=async_call_cmd,
exec_str=ask_or_write, aexec_str=ask_or_write_async,
input_parser=parameter_parser, output_parser=return_parser)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

syncable_command has too many parameters... much more comprehensible AND robust to call it with only kwargs.

@AdriaanRol
Copy link
Contributor

In general I think having a set and a get parser makes perfect sense 👍

@alexcjohnson
Copy link
Contributor Author

Thanks @AdriaanRol - any comments about val_mapping? Is it clear what this is for and how to use it?

@AdriaanRol
Copy link
Contributor

I think val_mapping itself is clear, the only thing that is not clear to me form the example is which end of the command is the user end (I assume '0' and '1') and which end is the instrument side (I assume 'one' and 'zero'). Maybe a one line comment to the test case there and all should be good.

@alexcjohnson
Copy link
Contributor Author

the only thing that is not clear to me form the example is which end of the command is the user end

Yes, that's always a concern with bidirectional mappings... - how's this?

@alexcjohnson
Copy link
Contributor Author

(and a tiny bit more)

@AdriaanRol
Copy link
Contributor

💃 (or was there something else here?)

alexcjohnson added a commit that referenced this pull request Feb 9, 2016
@alexcjohnson alexcjohnson merged commit 2f9d09c into master Feb 9, 2016
@alexcjohnson alexcjohnson deleted the param-parse branch February 9, 2016 14:17
nataliejpg pushed a commit to nataliejpg/Qcodes that referenced this pull request Apr 5, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Apr 10, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes May 2, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jun 1, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jun 22, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jun 27, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jul 7, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Jul 18, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 3, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 3, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 7, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 9, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 10, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 16, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 18, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Aug 22, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Sep 21, 2017
Only generate individual pdfs if more than one subplot
nataliejpg pushed a commit to nataliejpg/Qcodes that referenced this pull request Oct 11, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Oct 27, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Nov 21, 2017
Only generate individual pdfs if more than one subplot
jenshnielsen referenced this pull request in jenshnielsen/Qcodes Nov 23, 2017
Only generate individual pdfs if more than one subplot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants