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

Support xyce generated raw file #157

Merged
merged 7 commits into from
Feb 13, 2025
Merged

Conversation

hb020
Copy link
Collaborator

@hb020 hb020 commented Feb 12, 2025

Added a new parameter (dialect), because xyce does not declare itself. Just like ngspice not too long ago.
Added a new unittest, using examples of raw files from all supported sims.

@hb020 hb020 marked this pull request as draft February 12, 2025 14:46
@hb020 hb020 marked this pull request as ready for review February 12, 2025 14:49
Copy link
Owner

@nunobrum nunobrum left a comment

Choose a reason for hiding this comment

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

I'm OK with these changes. I have placed a few comments for future improvements, but it is nothing really critical and if you don't have the time to do it. I can do it later when I'll have a bit more time.

@@ -372,8 +376,12 @@ class RawRead(object):
'Noise Spectral Density',
'Frequency Response Analysis',
)

dialect = None
Copy link
Owner

Choose a reason for hiding this comment

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

Setting this as a class attribute, means that RawRead will not be able to read different raw files sources on the same execution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops, indeed, was not supposed to be a class attribute. Will correct that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

@@ -441,12 +449,77 @@ def __init__(self, raw_filename: str, traces_to_read: Union[str, List[str], Tupl
has_axis = self.raw_params['Plotname'] not in ('Operating Point', 'Transfer Function',)

reading_ltspice = 'Command' in self.raw_params and 'ltspice' in self.raw_params['Command'].lower()
Copy link
Owner

Choose a reason for hiding this comment

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

If a dialect is supplied, maybe we don't have to compute all these booleans. By the way, it would be more elegant if instead of all these variables if we use enum.Flags.
https://docs.python.org/3/library/enum.html#enum.Flag

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the different variables are a relic from the old code and from some ambiguous cases where one could have multiple of the flags active. That is no longer the case. Yes, I can simplify it. But still, I want to be able to detect a conflict between autodetect and forced dialect.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

@nunobrum
Copy link
Owner

Much much better.

@nunobrum nunobrum merged commit 4015a4a into main Feb 13, 2025
1 check passed
@nunobrum nunobrum deleted the support-xyce-generated-raw-file branch February 13, 2025 15:40
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.

ReadRaw Fails to Parse Xyce-Generated .raw File on Ubuntu (Block Size Mismatch Error)
2 participants