Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add th 800 to theory db #1896

Merged
merged 3 commits into from Dec 18, 2023
Merged

Add th 800 to theory db #1896

merged 3 commits into from Dec 18, 2023

Conversation

giacomomagni
Copy link
Contributor

This PR is to add th 800 for polarized evoution.

kbthr: 4.0
IC: 0
Q0: 1.0

Copy link
Member

@RoyStegeman RoyStegeman left a comment

Choose a reason for hiding this comment

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

Why is kbthr still set to 4?

Would you mind moving 800 and 390 such that the theories are in order of theoryid?

@giacomomagni
Copy link
Contributor Author

Why is kbthr still set to 4?

Because we are using aFONLL for the time being.
But I actually made a mistake, as here kbthr should not be changed as the evolution eko will be incorrect, will fix it.

Would you mind moving 800 and 390 such that the theories are in order of theoryid?

I can do it, do you have a script to do that by chance?

@RoyStegeman
Copy link
Member

I can do it, do you have a script to do that by chance?

No I would export it as a csv, change that, and then load it again.

Ah you were of course just using a GUI to add the new theory but that doesn't allow you to change the order. We should really get rid of this database... though while it's still there I do think we should try to keep it organised.

@scarlehoff
Copy link
Member

The only reason I haven't gotten rid of this database is that the cpp code (like evolven3fit) needs it.

As soon as the python installation is finished and evolven3fit replaced, the theorydb is going next. It will probably arrive to 2024 alive but I can promise you it doesn't get to Februrary.

@giacomomagni
Copy link
Contributor Author

giacomomagni commented Dec 15, 2023

Okay this is the snippet I used.
Could you please check I haven't messed up anything?

import sqlite3
import pandas as pd

conn = sqlite3.connect("theory.db")
cur = conn.cursor()
data = cur.execute("SELECT * FROM TheoryIndex")

columns = conn.execute("PRAGMA table_info('TheoryIndex')")

headers = [v for (_, v, _, _, _, _) in columns]

lines = [th for th in data]
df = pd.DataFrame(lines, columns=headers)

# sort
df.sort_values('ID', inplace=True)

conn2 = sqlite3.connect("sorted_theory.db")

#push the dataframe to sql 
df.to_sql("TheoryIndex", conn2, if_exists="replace", index=False)

Copy link
Member

@RoyStegeman RoyStegeman left a comment

Choose a reason for hiding this comment

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

The script looks good. Thanks!

@giacomomagni
Copy link
Contributor Author

Okay thanks, I'll merge it tomorrow.

@giacomomagni giacomomagni merged commit 764afca into master Dec 18, 2023
6 checks passed
@giacomomagni giacomomagni deleted the add_th_800 branch December 18, 2023 09:01
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.

None yet

3 participants