Package: ekpy
Welcome to EKPyA repository of analysis and computer control code for various experiments. Image above is an example of datacollectedandanalyzedusing this package.See here for introdution videosOverviewInstallationDevelopmentImportant LinksChange LogSupportCite this codeCited byOverviewEKPy (formerly ekpmeasure) is a set of control and analysis code designed to help streamline experiments. The basic idea is that in experimental work we often take data from many different sources, store it in different places, have varying degrees meta data associated with the data (even for a single type of data) and somehow(!) we are supposed to make sense of it all. We like to compare across trials, days, experimental conditions, etc. and it is very difficult to keep track of what data is where, and quickly access it when we need it. Often I find that folks end up copying and pasting raw data between excel spreadsheets and if you're not careful you will quickly lose track of which data came from where. This package's goal is to make this all easier.You may not find the experimental control code as helpful as it is relatively specific to my research in condensed matter physics (though electrical engineers or similar may find it very useful) but the analysis code is for everyone.At the heart of the analysis is theDatasetclass which is a means of manipulatingmeta data alonein order to locate which actual data you want to analyze.Datasetsdon't care about what the real data looks like, and they keep track of where different data is stored so it is easy to select which data you want to look at - only then do you retrieve the data. The real data is returned in aDataclass which allows you to group by parameters, perform calculations and much more.I am always improving this repository and if you have suggestions, I appreciate any feedback and or issues (https://github.com/eparsonnet93/ekpmeasure/issues)Seeexamplesfor more.Installation:If you plan to use EKPy to control your experiments. You will need to installNI-VISAfirst.Find the latest buildhere.pipinstallekpyor to upgrade to the latest versionpipinstall-UekpyYou can also access.whlor.tar.gzfiles in thedist/directory directly for installation.For installation issues, please seeIssue TrackerThere are also specificexperimentsthat can be installed following installation ofekpy. Please see the accompanying readme (e.g.,here) for such cases.DevelopmentWe welcome new contributors of all experience levels. Please reach out directly (e.parsonnet@berkeley.edu) to inqure about getting involved.Important LinksOfficial source code repo:https://github.com/eparsonnet93/ekpmeasureIssue tracker:https://github.com/eparsonnet93/ekpmeasure/issuesChange logVersion 0.1.14With help form Geo!Updates to utils to make to improve the functionget_number_and_suffix+ other updates to include additional instruments and fixes.Version 0.1.13Can now group Data.data.groupbyCan now remove nans from data.data.dropnaImprovements to file management in control, saving, and more appropriate trial incrementing incontrol.experimentFunctions used indata.applyshould no longer require the use of iterable data arrays. Please raise an issue if one occurs.Version 0.1.12Added functionality toanalysis.radiantSpeed increase fordata.get_data()Minor bugs and other fixesVersion 0.1.11experiment.print_run_function_argsis gone. It has been replaced withexperiment.show_run_function_helpAdded a header of meta data to the default save function forcontrol.experimentand started the process of doing away with meta_data.pklfiles in favor of.csv(why did I ever think that was a good idea?)Version 0.1.10minor bug fixes and documentation updatesVersion 0.1.9minor bug fixesVersion 0.1.82/18/22bug fixes from 0.1.7 and changed install name toekpy.Version 0.1.61/23/22addedData.to_DataFrame()which allows one to convertDatatopandas.DataFrame. Each index ofDatawill be a single row in the resulting DataFrame.Version 0.1.51/12/22merge_Dataswas replaced. The older version is nowconcat_Datasas it was really just concatenation, not merging. Merging now has real meaning, to merge a set of similar data objects on a specified definition key. Please report errors as they arise.similarymerge_Datasetsis deprecated. One must useconcat_Datasets.Version 0.1.412/2/21Added experiments module withferroelectricexperiments. This contains both relaxation (_relaxation) and switching (_switching) experiments. These consist of self contained jupyter notebooks that can be installed bypython -m ekpy.experiments.ferroelectric.<experiment_name>. For more see the experiment specific README forrelaxationorswitchingBug fix onData.sort11/16/21Data.applynow allows for dropping data. This can be executed by having the function in.applyreturn'None'.data_array_builder.buildnow allows one to fix lengths on 1D data by appending nans to make all data arrays the same length.analysis.plotting.add_legend_elementnow allows kwarg fontsize11/19/21Datacan now be saved. Usedata.to_ekpdat.Can be loaded asanalysis.read_ekpdatVersion 0.1.311/11/21Minor fixes for deprecations incontrol.miscVersion 0.1.211/7/21Speed improvements toDataset.remove_nonexistent_filesDataobjects can now be sorted by a definition parameterVersion 0.1.111/2/21Updates to plotting during experimental control. Now one can simply override thecontrol.experimentmethod_plotto define how plotting will take place. Here is a brief example of such an override:fromekpy.controlimportplottingfromekpy.controlimportexperimentimportmatplotlib.pyplotaspltclassexp(experiment):...def_plot(self,data,scan_params):ifhasattr(self,'fig')andhasattr(self,'ax'):passelse:fig,ax=plt.subplots()self.fig=figself.ax=axself.ax.scatter(scan_params['frequency'],np.mean(data['R']),color='blue')plt.show(self.fig)plotting.update_plot(self.fig)...Version 0.1.010/24/21Dataset class is no longer subclass ofpandas.DataFrame. This is to limit usage of unsupported functions.Data class updates including sorting and collapsing.One can access data or definition directly as an attribute nowData.definition, for example. One can also access pieces of information such as the real data corresponding top1asData.p1or definition keys,e.g.high_voltageasData.high_voltageExperiment class now saves a backup.csvmeta data file in addition to the pickle file in order to help with errors related to different pandas versions on various machines.SupportCode related issues (e.g. bugs, feature requests) can be created in theissue trackerMaintainer: Eric ParsonnetCitationPlease cite this work following theCITATION.cff(seeherefor more details on how to cite.)Cited ByE. Parsonnet, L. Caretta, V. Nagarajan, H. Zhang, H. Taghinejad, P. Behera, X. Huang, P. Kavle, A. Fernandez, D. Nikonov, H. Li, I. Young, J. Analytis, and R. Ramesh,Non-Volatile Electric Field Control of Thermal Magnons in the Absence of an Applied Magnetic Field, Arxiv (2022).