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

Binary exporter support for structs. #420

Closed
wants to merge 10 commits into from
Closed

Conversation

UlfBj
Copy link
Contributor

@UlfBj UlfBj commented Oct 23, 2024

No description provided.

@@ -126,12 +129,15 @@ def cli(
overlays: tuple[Path],
quantities: tuple[Path],
units: tuple[Path],
types: tuple[Path],
types_output: Path,
extend_all_attributes: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not using that, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

extend_all_attributes is probably not needed. The other two are referenced at other places in the code so I assume they are needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah so please get rid of the unused ones

@erikbosch
Copy link
Collaborator

Rebase needed to solve conflicts. Let me know if you experience any problems

@UlfBj
Copy link
Contributor Author

UlfBj commented Oct 24, 2024

@erikbosch , It seems uuid should no longer be used? Can it just be removed as a parameter in the export_node() call?

@sschleemilch
Copy link
Collaborator

@erikbosch , It seems uuid should no longer be used? Can it just be removed as a parameter in the export_node() call?

It is already removed from that on master

log.info("Generating binary output...")
if datatype_tree:
if types_output:
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if types_output is not defined?
Usually other exporters export the types then bundled into the main file.
I think either it needs to throw an error in that case for the user or defining a default types output file or ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test shows that if --types-output is not used in the make command the second if statement becomes false.

Copy link
Collaborator

Choose a reason for hiding this comment

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

does not really answer my question because if datatype_tree is still true then but we are not doing anything with that info in that case

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ulf - I suggest you add an else statement, something like

else:
  log.warning("To generate datatype tree output you must specify wanted output file")

or

else:
  log.warning("Ignoring type tree generation as no file name specified")

... that gives a hint that they maybe have forgotten to specify output file.

with open(str(output), "wb") as f:
export_node(tree, f)
log.info("Binary output generated in %s", output)
log.info("Binary main tree output generated in %s", output)

Copy link
Collaborator

Choose a reason for hiding this comment

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

pre-commit complains on this empty line (i.e. two end of line at end of file, should only be one.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@UlfBj - if you just remove a line break here then two of the CI-failures should dissappear

@erikbosch
Copy link
Collaborator

MoM:

  • Please review until end of week

@erikbosch
Copy link
Collaborator

If you add the else statement suggested and remove the extra line break at end of file I think this PR should be good to go.

One idea - should you possibly say something about how to use the new feature in
https://github.com/COVESA/vss-tools/blob/master/binary/README.md

@erikbosch
Copy link
Collaborator

MoM:

  • Ulf to update according to comments
  • Ok to merge when comment addressed

Signed-off-by: Ulf Bjorkengren <[email protected]>
@UlfBj
Copy link
Contributor Author

UlfBj commented Nov 11, 2024

Updted according to comments but did not fix it.

erikbosch added a commit to boschglobal/vss-tools that referenced this pull request Nov 11, 2024
Based on COVESA#420

Signed-off-by: Ulf Bjorkengren <[email protected]>
erikbosch added a commit to boschglobal/vss-tools that referenced this pull request Nov 11, 2024
Based on COVESA#420

Signed-off-by: Ulf Bjorkengren <[email protected]>
Signed-off-by: Erik Jaegervall <[email protected]>
erikbosch added a commit that referenced this pull request Nov 11, 2024
Based on #420

Signed-off-by: Ulf Bjorkengren <[email protected]>
Signed-off-by: Erik Jaegervall <[email protected]>
@erikbosch
Copy link
Collaborator

Merged through #428

@erikbosch erikbosch closed this Nov 11, 2024
@UlfBj UlfBj deleted the master branch November 13, 2024 15:43
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.

3 participants