Skip to content

Conversation

@hilaryh
Copy link
Contributor

@hilaryh hilaryh commented Dec 11, 2024

Description

  • Updated subtraction_plots.py to make plots easier to read
  • Edited run_herg_qc to allow for less specific export_config.py protocol dict

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Testing

  • Testing is done automatically and codecov shows test coverage
  • This cannot be tested automatically

Documentation checklist

  • I have updated all documentation in the code where necessary.
  • I have checked spelling in all (new) comments and documentation.
  • I have added a note to RELEASE.md if relevant (new feature, breaking change, or notable bug fix).

@codecov
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 34.32836% with 88 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@f5e5052). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pcpostprocess/subtraction_plots.py 34.32% 88 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #53   +/-   ##
=======================================
  Coverage        ?   78.79%           
=======================================
  Files           ?        7           
  Lines           ?      646           
  Branches        ?        0           
=======================================
  Hits            ?      509           
  Misses          ?      137           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MichaelClerx
Copy link
Member

I don't remember what this was, but perhaps I can generate some before and after plots to see if we like it?

@joeyshuttleworth
Copy link
Collaborator

Seems like the changes are sensible. There a few commented outlines that should probably just be outright removed. Before and after plots would be nice, but maybe we only need to look at the "after" versions!


data_list = os.listdir(args.data_directory)
export_config.D2S_QC = {x: y for x, y in export_config.D2S_QC.items() if
any([x == '_'.join(z.split('_')[:-1]) for z in data_list])}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should work fine. But this could throw an error if the files aren't set out properly. Maybe we should just check that there is at least one "_" in all of these files. I think it's mostly safe to assume that the data folders will be formatted correctly, but there's nothing stopping someone from dragging any other sort of file in there!

label=r'$I_\mathrm{L}$.' f"g={b1:1E}, E={-b0/b1:.1e}")
# sortedy = sorted(before_currents[i, :])
# ax.set_ylim(sortedy[30]*1.1, sortedy[-30]*1.1)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should probably just get rid of these commented-out lines

label=r"$I_\mathrm{L}$." f"g={b1:1E}, E={-b0/b1:.1e}")
# sortedy = sorted(after_currents[i, :])
# ax.set_ylim(sortedy[30]*1.1, sortedy[-30]*1.1)
# if ax.get_legend():
Copy link
Collaborator

Choose a reason for hiding this comment

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

More comments to remove

ax.set_ylabel(r'leak-corrected traces')
first = False

# sortedy = sorted(corrected_after_currents+corrected_before_currents)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments to delete

# ax.set_ylim(sortedy[60]*1.1, sortedy[-60]*1.1)
ax.legend()
# ax.tick_params(axis='y', rotation=90)
# ax.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.1e'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comments to delete


corr_dict = {'sweeps': sweeps, 'pcs': pcs}
return corr_dict

Copy link
Collaborator

Choose a reason for hiding this comment

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

Duplicated code from leak_correct.py?

We could remove the other file, but I don't think it's been deleted by these commits

Copy link
Member

@mirams mirams Jul 18, 2025

Choose a reason for hiding this comment

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

Yeah, I don't think we should be fitting the leak again with a new linear regression (just below here), we want to show the line we fitted elsewhere (in case we tweak the process there?)

Copy link
Collaborator

@joeyshuttleworth joeyshuttleworth left a comment

Choose a reason for hiding this comment

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

Looks good. Should remove some commented-out lines and either delete or change leak_correct.py so we don't duplicate code

@MichaelClerx
Copy link
Member

Before:
13112023_MW2-staircaseramp_2-A03-sweep1-subtraction

@MichaelClerx
Copy link
Member

After:
13112023_MW2-staircaseramp_2-A03-sweep1-subtraction

@MichaelClerx
Copy link
Member

Not sure this was finished? @hilaryh how's it going? Did you find a decent ☕ ?
Are these supposed to look like this?

@mirams
Copy link
Member

mirams commented Jun 24, 2025

Not sure this was finished? @hilaryh how's it going? Did you find a decent ☕ ? Are these supposed to look like this?

well they definitely don't look nice with the legend all over the top of the interesting bits and cut off text! But it is nice to use more plot area for plots than whitespace...

@mirams
Copy link
Member

mirams commented Jun 24, 2025

a bit more sharex and sharey and just showing tick marks instead of tick labels where they are shared would probably tidy it up a fair bit

@MichaelClerx
Copy link
Member

I feel like that may have been the commented out bit, @joeyshuttleworth ?

@hilaryh
Copy link
Contributor Author

hilaryh commented Jun 25, 2025

Not sure this was finished? @hilaryh how's it going? Did you find a decent ☕ ? Are these supposed to look like this?

Hi everyone! Decent coffee here. None hold a candle to Effy yet but I have high hopes for next Tuesday's pick. The plots are definitely not supposed to look like that! I may have forgotten to add subtraction_plots.py to my last commit... Will do now!

@hilaryh
Copy link
Contributor Author

hilaryh commented Jun 25, 2025

I've fixed the layout problems (I hope!). The commented out code can all be deleted - the sortedy parts were from a brief attempt to cut out the capacitative spikes in some of the harder to see traces without going back to the remove_capacitative_spikes code but obv something a little more robust is necessary.

@MichaelClerx
Copy link
Member

Thanks @hilaryh !

Copy link
Member

@mirams mirams left a comment

Choose a reason for hiding this comment

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

Could you paste up what the subtraction plot looks like now?


corr_dict = {'sweeps': sweeps, 'pcs': pcs}
return corr_dict

Copy link
Member

@mirams mirams Jul 18, 2025

Choose a reason for hiding this comment

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

Yeah, I don't think we should be fitting the leak again with a new linear regression (just below here), we want to show the line we fitted elsewhere (in case we tweak the process there?)

@MichaelClerx
Copy link
Member

OK will come back to this later

all_leak_params_after = []
for i in range(len(sweeps)):
before_params, _ = fit_linear_leak(before_currents, voltages, times,
before_params, _ = fit_linear_leak(before_currents[i, :], voltages, times,
Copy link
Member

Choose a reason for hiding this comment

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

@frankiepe - Hilary may already have done some of this, just in this branch!

@mirams mirams closed this Oct 30, 2025
@mirams
Copy link
Member

mirams commented Oct 30, 2025

I'll close this as a sort of duplicate / superceded by recent changes in #86, #87, #88, #89, #90, #91

@MichaelClerx MichaelClerx deleted the hilary_dev branch November 5, 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.

5 participants