ges-compchem / ges-echem-suite Goto Github PK
View Code? Open in Web Editor NEWLibrary containing different tools for electrochemical experimental data analysis.
Home Page: https://ges-compchem.github.io/GES-echem-suite/intro.html
Library containing different tools for electrochemical experimental data analysis.
Home Page: https://ges-compchem.github.io/GES-echem-suite/intro.html
Implement recognizing the dot as a decimal separator for single table DTA files.
Possible ideas:
Self explanatory.
It is probably wise to implement an exception.py
module containing all the exceptions and track all the exception types in the API reference and docstrings.
Implement fitting of the capacitive current section, detection of the peak current/voltage, automatic Randles-Sevcik regression etc.
.mpt files which contain a single cycle are not correctly processed by the read_mpt_cycles() routine.
The program expects a line containing "Number of loops : " to read the number of cycles and a series of lines starting with "Loop " to determine the cycles position:
for line_num, line in enumerate(file):
if "Number of loops : " in line:
ncycles = int(line.split(" ")[-1])
# Before the output of the experiment, EClab lists the
# starting and ending line of each loop. These will be used
# to slice the pandas dataframe into the different cycles.
if "Loop " in line:
loop_num = int(line.split(" ")[1])
first_pos = int(line.split(" ")[-3])
second_pos = int(line.split(" ")[-1])
delims.append([loop_num, first_pos, second_pos])
if "mode\t" in line:
beginning = line_num
break
This section is not present if the file contains a single cycle, which causes the program to not process the file correctly.
Suggested fix: after finding the line containing "mode", all the rest of the file is a single cycle, therefore it might be better to default ncycles = 1 and overwrite it only if "Number of loops : " is found. If ncycles == 1, then keep reading the file until the end.
The module should allow:
Possible nice to have features:
Tip: consider impedance.py
as a possible library to use.
esimi dottori <3,
può capitare che durante la registrazione di curve di carica/scarica lo strumento registri degli spike.
Sarebbe carino se poteste implementare un filtro che li rimuovesse qualora fosse desiderato.
Vi mando per mail l'esempio in cui mi è capitato di vederli con relativo file del nostro pittone preferito a computational boyz con annessi esempi.
un abbraccio
The Lannisters Send Their Regards
Line 750 of the cellcycling.read_input
module always triggers the hiding of the whole cycle if the charge halfcycle is missing. This happens even if the clean
option is set to False
.
If this is wanted close this issue, else a bug-fix is needed to set the correct ordering of the logic operator chain.
Suggested fix:
elif (not cycle.charge or not cycle.discharge) and clean:
The unphysical
tuple of conditions defined in the read_mpt_cycles
function at line 873 of the cellcycling.read_input
module can appear as undefined if either charge
or discharge
are not set.
Possible fix: Move and nest the if
condition defined at line 891 under the same if
statement under which unphysical
is set.
Biologic output files for experimental protocols containing loops and PEIS measurements have a different structure than typical cell cycling-only files.
In particular, the output file contains a header where the type of each operation performed in the protocol and an ID are stated.
Cycle Definition : Charge/Discharge alternance
Ns 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
ctrl_type Rest CC CC Rest PEIS CC Loop CC CC Rest PEIS CC Loop CC CC Rest PEIS CC Loop
Apply I/C I I I I I I I I I I I I I I I I I I I
current/potential current current current current current current current current current current current current current current current current current current current
ctrl1_val 1,000 1,000 10,000 1,000 1,500 1,500 1,500 10,000 1,500 1,500 2,000 2,000 10,000 2,000 2,500
ctrl1_val_unit A A mV A A A mV A A A mV A
ctrl1_val_vs <None> <None> <None> <None> <None> <None> <None> <None> <None>
...
Then, in the measurement data, a column with the ID of the operation is introduced:
mode ox/red error control changes Ns changes counter inc. Ns I Range time/s control/V/mA Ewe/V I/mA dq/mA.h (Q-Qo)/mA.h |Energy|/W.h freq/Hz |Z|/Ohm Phase(Z)/deg Q charge/discharge/mA.h half cycle Ece/V P/W <Ece>/V |Ece|/V Phase(Zce)/deg |Zce|/Ohm Re(Zce)/Ohm -Im(Zce)/Ohm Phase(Zwe-ce)/deg |Zwe-ce|/Ohm Re(Zwe-ce)/Ohm -Im(Zwe-ce)/Ohm z cycle Energy charge/W.h Energy discharge/W.h Capacitance charge/µF Capacitance discharge/µF Re(Z)/Ohm -Im(Z)/Ohm Re(Y)/Ohm-1 Im(Y)/Ohm-1 |Y|/Ohm-1 Phase(Y)/deg Q discharge/mA.h Q charge/mA.h Capacity/mA.h Efficiency/% control/V control/mA cycle number Ewe-Ece/V R/Ohm
3 0 0 0 0 0 0 6 1,191880056575610E+002 -1,6322504E-001 -1,6124701E-001 0,0000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,000000000000000E+000 0 -4,2314586E-004 0,0000000E+000 -4,2314586E-004 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,000000000000000E+000 -1,6082387E-001 0,0000000E+000
3 0 0 0 0 0 0 14 1,291880054049398E+002 0,0000000E+000 -1,6267009E-001 0,0000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,000000000000000E+000 0 8,8169865E-005 0,0000000E+000 8,8169865E-005 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,000000000000000E+000 0,0000000E+000 0,0000000E+000 0,0000000E+000 0,000000000000000E+000 -1,6275826E-001 0,0000000E+000
...
The current implementation of the cell cycling module of GES-echem-suite does not support this kind of data organization.
A modification of the code is required to maintain compatibility with this more advanced type of output file.
Declaration of Cycle
instance attributes should be moved within __init__
method. Their initialization can be delegated to a class method.
Implement Cycle
class properties that return a concatenation of charge and discharge data, e.g.:
@property
def time(self):
return self._time_charge.append(self._time_discharge)
Ho un problema per plottare un profilo di scarica in Python.
La scarica è stata fermata a metà del processo (pausa pranzo) e avviata dopo. Conseguentemente si sono generati 2 file.
Quando se avvia la seconda parte della scarica, il tempo (valori X) inizia da 0.
Quindi, per plottare la scarica completa, si devono unificare questi due file modificando i valori di X (tempo) del secondo file in maniera che parta dall'ultimo valore del primo file.
(Se la prima scarica è stata fermata a 784 secondi, il primo valore del secondo file deve essere 785 secondi)
Come si può fare?
Modify build_cycles() function to allow for the presence of cycles without either half-cycle.
Also, allow for the data to be in either order ([charge, discharge] and [discharge, charge])
Implement CellCycling class methods to return an estimate of the capacity retention at a given cycle and to find the cycle number after which it falls below a certain threshold:
# object cellcycling has already been previously initialized
def fit_function(x, a, b):
return a*x+b
fit_parameters = cellcycling.capacity_retention_fit(function=fit_function)
cycle_numbers = [0, 100, 200, 400]
# or cycle_numbers = range(0, 20000, 100)
retentions = cellcycling.capacity_retention_predict(cycle_numbers)
thresholds = [0.95, 0.8] # cret 95% and 80%
cycle_numbers = cellcycling.capacity_retention_threshold(thresholds)
Target final structure for the documentation:
The developer's guide should integrate the already existing documentation with:
Codebase Overview: Start with a high-level overview of your codebase. Describe the purpose of the library, its main features, and how it is structured at a high level. This includes the main modules, classes, and their relationships.
Directory Structure: Provide a clear explanation of the directory structure of your codebase. This should include the purpose of each directory and the type of files that can be found in them.
Key Components: Identify the key classes, functions, and modules in your codebase. For each of these, provide a brief description of its purpose, how it works, and how it interacts with other parts of the codebase.
The capacity_fade
property, pointing to the _capacity_fade
inner variable assumes values not compatible with a percentage. A better explanation of the parameter definition or a bug-fix is required.
If the capacity fade is intended as the linear capacity loss associated to each charge/discharge cycle the value computed do not appear to match physical meaning. The source of error can be located at this line. The _retention_fit_parameters.slope
already derives from the fitting of percentage capacity_retention
values and, as such, the multiplication by the factor 100
should not be required.
Implement functions to compute difference, sum, multiplication and division between CV traces to help in the comparison of CV experiments. (e.g. subtracting blanck traces etc..)
With the current implementation, cycles which have been removed due to unphysical nature cause an index error at the iterator level.
Allow the user to manually hide cycles from CellCycling instances. Cycles should not be deleted so that data can be shown again if necessary?
Example:
...
cycles.indexes # to be implemented
# returns [0, 1, 2, 3, 4, 5]
cycles.coulombic_efficiencies
# returns [99, 96, 57, 98, 94, 33]
cycles.mask([2, 4, 5]) # use list of cycles indexes
cycles.indexes
# returns [0, 1, 3]
cycles.coulombic_efficiencies
# returns [99, 96, 98]
cycles.unmask([2]) # unmask selected cycles
cycles.indexes
# returns [0, 1, 2, 3]
cycles.coulombic_efficiencies
# returns [99, 96, 57, 98]
cycles.unmask() # unmask all cycles
cycles.indexes
# returns [0, 1, 2, 3, 4, 5]
cycles.coulombic_efficiencies
# returns [99, 96, 57, 98, 94, 33]
It could be done by modifiying the __iter__
method to check on a list of hidden cycles, and editing the properties to cycle on self
rather than on the self._cycles
instance attribute.
The capacity_retention
property should be modified to calculate the retentions on the spot, e.g.:
cycles.capacities
# returns [100, 50, 50, 50]
cycles.capacity_retention
# returns [100, 50, 50, 50]
cycles.reference = 1
cycles.capacity_retention
# returns [200, 100, 100 ,100]
We can then remove the function calculate_capacity_retention
. @GES-lbabetto what do you think?
We should implement the capacity retentions calculation via numpy instead of cyclying in a python for loop :)
Define a FileManager class to handle import, merge and organization of multiple half-cycle files. Include BytesIO compatibility for easy streamlit app development.
If the sampling rate of the cellcycling is based on constant mV and not seconds, then the timeserie will have different time deltas between each element. This generate an artifact when reversing the series, for which the elementwise delta is not conserved, and therefore the plot is not shown properly.
Fix this issue in order to get the correct inverted plot.
Complete a general update of the cyclic-voltammetry module to improve ease of use:
Pandas version < 1.3.0 do not have the encoding_errors keyword for the dataframe read_table function and will throw an error when the user reads a file.
Fix meta.yaml with the correct dependency specifying the correct version number.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.