Skip to content

"Add support for the mf4 io format" (Adapted version of #554) #697

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

Closed
wants to merge 55 commits into from

Conversation

felixdivo
Copy link
Collaborator

@felixdivo felixdivo commented Sep 4, 2019

See #554 for the changes. This PR was created such that some changes could be applied before merging into the develop.

There is still an issue on PyPy (#696), but it's okay to merge for now since it runs nicely on CPython.

Closes #506.

@@ -0,0 +1,392 @@
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this class also be added to the lookup dictionaries in the logger.py and player.py files?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've added them


def __init__(self, file):
"""
:param file: a path-like object or as file-like object to read from
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/as file-like object/a file-like object

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed

@felixdivo
Copy link
Collaborator Author

Hey @danielhrisca thanks for taking care of this, but where exactly did you push the changes so that I can pull them into this repo?

@danielhrisca
Copy link
Contributor

I've pushed the commits to my branch https://github.com/danielhrisca/python-can/tree/mf4_io

@felixdivo
Copy link
Collaborator Author

Okay, I rebased this branch on your work. It was quite strange, but I hope everything went right. Please base you next modifications on this branch directly. ;)

One issue remains though:

can/io/player.py:24: error: Cannot assign to a type
can/io/player.py:24: error: Incompatible types in assignment (expression has type "None", variable has type "Type[MF4Reader]")
can/io/logger.py:25: error: Cannot assign to a type
can/io/logger.py:25: error: Incompatible types in assignment (expression has type "None", variable has type "Type[MF4Writer]")

It might need some fix.

@felixdivo
Copy link
Collaborator Author

c311af4 should fix that

@felixdivo
Copy link
Collaborator Author

Okay, I guess this can be merged now. (@karlding / @danielhrisca ?)

@karlding
Copy link
Collaborator

karlding commented Oct 7, 2019

Can you check your rebase @felixdivo please?

I see various diffs in @danielhrisca's branch which don't seem to be reflected here.

@felixdivo
Copy link
Collaborator Author

Uff, I hate history rewriting. I might give it another try, will see when I have time.

:param database: optional path to a DBC or ARXML file that contains
message description.
"""
super().__init__(file, mode="r+b")
Copy link
Contributor

Choose a reason for hiding this comment

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

Description says to open in write binary, but code uses read binary mode.

@felixdivo
Copy link
Collaborator Author

Sorry, I currently do not have the time to complete this or work much on this project.

@felixdivo felixdivo removed their assignment Oct 18, 2019
@aahmed-at
Copy link

Is this anytime soon getting merged?

@felixdivo
Copy link
Collaborator Author

I don't really know what went wrong here.

However, the branch and all discussions are still there. Anyone is free to provide a clean PR. I will probably not do it.

@felixdivo felixdivo closed this Dec 13, 2020
@hardbyte
Copy link
Owner

For anyone tracing along in the future, the next iteration is #1289

@hardbyte hardbyte deleted the mf4-io branch November 14, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement file-io about reading & writing to files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add MF4 io writer
6 participants