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

Plotting for PMOS devices not working #1

Open
restfet opened this issue Feb 1, 2024 · 0 comments
Open

Plotting for PMOS devices not working #1

restfet opened this issue Feb 1, 2024 · 0 comments

Comments

@restfet
Copy link

restfet commented Feb 1, 2024

Creating plots for PMOS devices wouldn't work for me, either creating empty plots without any graphs or outright crashing my scripts.

After debugging for a while I noticed the get_indices method would return empty arrays for pmos devices. I applied the following fix in the get_indices method:

if isinstance(target, tuple): # when `vsb, vgs, vds` is a range
    start, end = target[:2]
    
    if self.mos == "nmos":
        indices = np.where((data >= start) & (data <= end))[0]
    if self.mos == "pmos":
        indices = np.where((data <= start) & (data >= end))[0]
    
    if len(target) == 3:  # if it contains a step
          step = int(target[2] / (data[1] - data[0]))
          indices = indices[::step]

I can't say if this fix could introduce bugs or errors elsewhere, but it appears to have done the trick.

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

No branches or pull requests

1 participant