jflamy / owlcms4

Olympic Weightlifting Competition Management System
https://owlcms.github.io/owlcms4/#/index
Other
67 stars 22 forks source link

Make elite points classification (Spain) #701

Closed danirueda closed 1 year ago

danirueda commented 1 year ago

It would be great for Spanish users to have elite points classification as a column in competition results and as a sheet in sheet results like Sinclair or Robi points for male and female.

What are elite points (puntos élite)?

Elite points (Puntos Élite) is a score that is only used in Spain. It's used as a qualifying score which an athlete can participate in national championships. It's the same as a qualifying total but with score. Also it's used to make a global classification for all athletes and win cups or medals like Sinclair points in competitions.

How is it calculated?

This explanation is not exactly, but it's the main procedure.

For each period of time (years) for each category the average of ten world best totals is calculated and elite score is a percentage of this average. For example, let's imagine in M89 this average is 387 kg. If an athlete total is 245 kg his points are (245/387)*100 = 63,30 elite points.

All points for all group ages for all categories for all totals for both genders are calculated and stored in elite points tables. And to know how much points and athlete has done only we have to look the table.

Where can I find those points?

Elite points tables are stored in Spanish Weightlifting Federation web page. They can be found here.

How can I scrap information?

You can use:

  1. pdfgrep to get table rows from PDF with a minimal regex like [0-9]+.*.
  2. grep and sed to clean data.
  3. Write a small script in Python or Shell to add all left delimiters because of white cells in source and get a CSV file to use in code.

What would be the best way to get this clasification?

Because this is only a score used in Spain I think there are two ways.

  1. If language es_ES is selected, a new column and news sheet for both genders will appear in results sections and results documents.
  2. Put a check in competition options to check and get the column and sheet in results sections and results documents for both genders.
  3. A mix of previous options. If language es_ES is selected, a check in competition options will appear and the user can check it.
jflamy commented 1 year ago

You can create your own Excel template and do all the computations you want. You would simply add the Excel to the local/templates directory.

You would have your tables inside the template file, usually in separate sheets. Then you would use the Excel bloom up function to use the values in a formula. When your tables change you would update the Excel. If this needs to be dynamic you can use VBA code but such reference tables are usually updated yearly or less.

To use, would simply select your custom template from the list.

There would be no changes to the program.

Le dim. 9 juill. 2023 à 13:52, Daniel Rueda @.***> a écrit :

It would be great for Spanish users to have elite points classification as a column in competition results and as a sheet in sheet results like Sinclair or Robi points for male and female. What are elite points (puntos élite)?

Elite points (Puntos Élite) is a score that is only used in Spain. It's used as a qualifying score which an athlete can participate in national championships. It's the same as a qualifying total but with score. Also it's used to make a global classification for all athletes and win cups or medals like Sinclair points in competitions. How is it calculated?

This explanation is not exactly, but it's the main procedure.

For each period of time (years) for each category the average of ten world best totals is calculated and elite score is a percentage of this average. For example, let's imagine in M89 this average is 387 kg. If an athlete total is 245 kg his points are (245/387)*100 = 63,30 elite points.

All points for all group ages for all categories for all totals for both genders are calculated and stored in elite points tables. And to know how much points and athlete has done only we have to look the table. Where can I find those points?

Elite points tables are stored in Spanish Weightlifting Federation web page https://u31188123.ct.sendgrid.net/ls/click?upn=twvwc57zWERHmKZbfuRICBbcjkNNCLH46NvS-2F0ZsmGR5SSmt0KSmBeL73bamddpx3FnG_U31jt5HgHBh7k3Grc5s4l4Dftbug7qATGPHZF2dCsL5z7HRVJYKZhzc-2FYHzO-2BGh3JAU6p-2B4S3z6klpKcFhDLXW6Pl8SNIoSoMcg1oeAt-2BeBpLpvkr8YLYxJ7r8Lprh515oCrlwwomVVoGKXDXa4KCGeblEEU6H6zSaB6xhuSH5XBOa-2FDTXkR7AaRDoHram-2BZxWYXfNKkx5Q01uymCVLDNioS0edvJWE4ceZSfgDA4RCt0GnnHpTgJo0r8aNZFSvPAnBuqOSwFyC3O-2BppAiDpNg-3D-3D. They can be found here.

How can I scrap information?

You can use:

  1. pdfgrep to get table rows from PDF with a minimal regex like [0-9]+.*.
  2. grep and sed to clean data.
  3. Write a small script in Python or Shell to add all left delimiters because of white cells in source and get a CSV file to use in code.

What would be the best way to get this clasification?

Because this is only a score used in Spain I think there are two ways.

  1. If language es_ES is selected, a new column and news sheet for both genders will appear in results sections and results documents.
  2. Put a check in competition options to check and get the column and sheet in results sections and results documents for both genders.
  3. A mix of previous options. If language es_ES is selected, a check in competition options will appear and the user can check it.

— Reply to this email directly, view it on GitHub https://u31188123.ct.sendgrid.net/ls/click?upn=twvwc57zWERHmKZbfuRICMMwxrmQ5t4YYteB6LEqhedasFyhr-2BiIrutaLljtnRQee1Wg6ZoMJTviO00Y42b9cA-3D-3DySp1_U31jt5HgHBh7k3Grc5s4l4Dftbug7qATGPHZF2dCsL5z7HRVJYKZhzc-2FYHzO-2BGh3JAU6p-2B4S3z6klpKcFhDLXW6Pl8SNIoSoMcg1oeAt-2BeBpLpvkr8YLYxJ7r8Lprh51YVsYOim9y8aWeO5tOULv7Nfu9cwr1t0MzpEG9Y2YqwCWvj5GKViAiFGwVSQFX2URYPh4AnFD62iHeSvOAo2FgyRitJMwaBXSiQAEqM9HVhBZVHS4eDZcYWHhVLcnQaf-2FA8JuaiGZqEh7PAPc8z6qcQ-3D-3D, or unsubscribe https://u31188123.ct.sendgrid.net/ls/click?upn=twvwc57zWERHmKZbfuRICGWiUOjzw-2BuO0cWzQATJEwWt1x36krrFuZOOa7gupKh3fZzerN9KqmdbKk9xj3H0jvpCnvp1YAUXxUgRe5nRKkq5RVJ7p0-2FawhiMST6XtPp1NDHTdldvlceIOJYr8tyYng-3D-3Dvqxp_U31jt5HgHBh7k3Grc5s4l4Dftbug7qATGPHZF2dCsL5z7HRVJYKZhzc-2FYHzO-2BGh3JAU6p-2B4S3z6klpKcFhDLXW6Pl8SNIoSoMcg1oeAt-2BeBpLpvkr8YLYxJ7r8Lprh51q08iISq4cPSmPtnqFQMS3C1YobUA4b3SMHu3XtuMaSNH5CkPVteJcLmaQ-2BwiM9s-2FA7pmQiujtcoxZnOYKBV7bYOzJUy07j2DDoCqJIy8kNdZFEfYtwZ0mQ-2BTz-2FxW-2BlPCu4tjQyCYqXr3RIeYDsqmBA-3D-3D . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- (Envoyé de mon téléphone mobile.)

jflamy commented 1 year ago

As explained, what you require can already be done without changing owlcms

danirueda commented 1 year ago

I'll do it. When I got it, I'll make a pull request or I'll send you the file.

Thank you!

jflamy commented 1 year ago

Many federations have their own set of files that they update periodically. For example, national records, or variations on the standard templates to add logos etc.

You will likely also have regional flags, federation logos, eventually tweaked style sheets, etc.

So it is better for you to create à Spain « local » with all your additions or overrides. That way any Spanish club or region using owlcms would just drop the folder on top of the existing local and accept replacing existing files if needed.

Message ID: @.***>

-- (Envoyé de mon téléphone mobile.)

danirueda commented 1 year ago

I work alone and I would like all regional federations in Spain to have this functionality. I understand this is a change only for a country and It's useless to have it globally in software, so I'll contact with all regional federations and I'll share that Excel template when I got it. Who knows, perhaps someone has this already or I can be the first to do it!

Thank you!

El mié, 12 jul 2023, 17:08, Jean-François Lamy @.***> escribió:

Many federations have their own set of files that they update periodically. For example, national records, or variations on the standard templates to add logos etc.

You will likely also have regional flags, federation logos, eventually tweaked style sheets, etc.

So it is better for you to create à Spain « local » with all your additions or overrides. That way any Spanish club or region using owlcms would just drop the folder on top of the existing local and accept replacing existing files if needed.

Message ID: @.***>

-- (Envoyé de mon téléphone mobile.)

— Reply to this email directly, view it on GitHub https://github.com/jflamy/owlcms4/issues/701#issuecomment-1632720081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3EH7576ORHVWYECXSJ5JLXP24XFANCNFSM6AAAAAA2DVFKMU . You are receiving this because you authored the thread.Message ID: @.***>

danirueda commented 1 year ago

@jflamy I got it!

It's not 100% automatic, but 90%. As you said I scraped the tables and I put them in two hidden sheets.

After this I removed columns and changed template variable category to bWCategory to match elite point tables headers and I put the formula in template cell.

When book is generated I have to write category cells again for the formula to be recalculated and finally use bloom up function because formula is referenced to the first row due to template.

For global classification also I have to make sheet order by elite points column descending and it's done.

Here are the results.

Thank you!

Global classification

Female

elite-femenino-total

Male

elite-masculino-total

Categories

Female

elite-femenino

Male

elite-masculino