Step 5 - Sort indexes¶
Genereate all_csv file¶
Once all the formulas are done (all the csv), we execute the following line:
python FORMULAS/append_csv.py <txt_name>
For our example it is this:
python FORMULAS/append_csv.py quadratic
Understandig all_csv file¶
This will generate a new file in the CSV folder from step 4 called all_csv.csv. Once created, I recommend opening it with the LibreOffice Calc program, but you can do it with English.
If you try to open it with LibreOffice the following window will appear:
Click on one of the columns of the data and press Ctrl + a and this will select all the columns:
Then, in the Column Type property, select Text, and then press Ok.
This all_csv file will contain the following format, is separated by steps, and each step distinguishes the following parts:
- PRE_FORMULAS CONFIG
- Before transformation
pre_fade: The symbols indicated by these indexes disappear before the animation.pre_copy: Explanation below.
- While transformation occurs
run_fade: The symbols indicated by these indexes disappear during the animation.
- POS_FORMULAS CONFIG
- While transformation occurs
run_write: The symbols indicated by these indexes appear (with theWriteanimation) during the animation.
- After transformation
pos_write: The symbols indicated by these indexes appear (with theWriteanimation) after the animation.pos_copy: Explanation below.
It is recommended to use colors to detect the symbols that are repeated in a pattern:
Sort indexes¶
Then, the indexes must be related one by one. that is to say:
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
0 |
1 |
2 |
3 |
4 |
5 |
7 |
8 |
6 |
9 |
We see that the first 6 symbols (from 0 to 5) are identical, but the rest are not, and the last symbol of the pre_formula has no relation, so it must disappear, either using run_fade or pre_fade.
So the sheet looks like this:
Warning
Remember to save the file in .ods format, because the CSV format only saves the row and column format.
Special case¶
In the event that a symbol of one pre_form is transformed into two of pos_formula then the following has to be done: (we will use Step 2 as an example)
In this example we see that index 0 of the pre_formula is going to be transformed into index 5 and 11 of the pos_formula. In these cases a copy of the index of the pre_formula must be made, then we decided that index 0 will become symbol 5 and that copy 0 will become 11. That is:
0 |
0 copy |
\(\cdots\) |
5 |
11 |
\(\cdots\) |
In the event that many formulas are transformed to one, then they simply repeat the index of the pos_formula as many times as necessary. Here is the fully ordered ODS file for reference.