-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
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.
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.
spicelib/raw/raw_read.py
Outdated
@@ -372,8 +376,12 @@ class RawRead(object): | |||
'Noise Spectral Density', | |||
'Frequency Response Analysis', | |||
) | |||
|
|||
dialect = None |
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.
Setting this as a class attribute, means that RawRead will not be able to read different raw files sources on the same execution.
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.
oops, indeed, was not supposed to be a class attribute. Will correct that.
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.
done.
spicelib/raw/raw_read.py
Outdated
@@ -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() |
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.
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
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.
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.
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.
done.
Much much better. |
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.