-
Notifications
You must be signed in to change notification settings - Fork 32
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
add args to conversion to be returnable as json #1512
Changes from 4 commits
a9649ae
1cbfad3
8c2257d
0399b5d
680e218
1a402b5
1c6989b
e8bf78f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,14 @@ class Conversion: | |
# attr_reader :converted_bit_size | ||
# # self.return [Integer] The size in bits of the converted array value | ||
# attr_reader :converted_array_size | ||
# attr_reader :args | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be params |
||
|
||
# Create a new conversion | ||
def __init__(self): | ||
self.converted_type = None | ||
self.converted_bit_size = None | ||
self.converted_array_size = None | ||
self.params = None | ||
|
||
# Perform the conversion on the value. | ||
# | ||
|
@@ -61,4 +63,6 @@ def as_json(self): | |
result["converted_bit_size"] = self.converted_bit_size | ||
if self.converted_array_size is not None: | ||
result["converted_array_size"] = self.converted_array_size | ||
if self.params is not None: | ||
result["params"] = self.params | ||
return result |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ def __init__( | |
self.converted_bit_size = int(converted_bit_size) | ||
if ConfigParser.handle_none(converted_array_size): | ||
self.converted_array_size = int(converted_array_size) | ||
self.params = [self.processor_name, self.result_name] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing converted_ params There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Base class records those ... they are output in the to_config method. as_json outputs them separately and the remaining parameters get put into params. |
||
|
||
# @param (see Conversion#call) | ||
# @return [Varies] The result of the associated processor | ||
|
@@ -71,14 +72,3 @@ def to_config(self, read_or_write): | |
config += f" {self.converted_array_size}" | ||
config += "\n" | ||
return config | ||
|
||
def as_json(self): | ||
result = super().as_json() | ||
result["params"] = [ | ||
self.processor_name, | ||
self.result_name, | ||
self.converted_type, | ||
self.converted_bit_size, | ||
self.converted_array_size, | ||
] | ||
return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MIssing converted_ params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base class records those ... they are output in the
to_config
method.as_json
outputs them separately and the remaining parameters get put intoparams
.