bmcguir2 / astromol

16 stars 5 forks source link

Merging astromol and spacetar #15

Closed astrogewgaw closed 3 years ago

astrogewgaw commented 3 years ago

Recently I had started working on spacetar, which is kind of like my own version of astromol 😅 . I decided to make the project because I had some time on my hands, and I also had a lot of ideas on how to go about implementing a package like this. However, now that astromol has come into the picture, developing my own package feels kind of redundant. I don't mind developing it for fun, but I think its a better idea for the two packages to merge their functionalities instead. For instance, right now the database is hard-coded as a series of instances of the Molecule class. In spacetar, I have kept all data (that is, the molecules, sources and telescopes) in a number of JSON files, which are then combined into a SQLite database. This has two major advantages:

  1. The database can be easily modified by modifying the JSON files. This does not affect the codebase in any way (unless you add a new field). To make modifications even easier, the data can be stored as CSV files instead (and edited through Google Sheets or something). I only chose JSON because of its ease of usage and because it is cross-platform.
  2. The database is searchable. This is exactly why I chose to make an SQLite database in the first place, because searching for a molecule (or a source or telescope) by any of its parameters is easy as 🥧 , thanks to packages like SQLAlchemy. You can even do wildcard searches.

We still have Molecule, Source and Telescope classes. The cool thing is that these map directly to the SQLite database, so they can be used to search the database etc, and you can treat them like a normal class and add properties to calculate things (like the degree of unsaturation). The only downside is that searching the database for a property is not possible through an SQL query, so I came up with a nice workaround that has now been implemented in spacetar.

Similarly, I think it would be a good idea to have a CLI with astromol, just like spacetar. This allows people to interact with the database immediately through the command line. Using packages like rich and click, constructing the CLI is quite easy, and it looks pretty good too!

For all the reasons above, I think it would be a good idea for astromol and spacetar to join forces. I understand that PRs are closed right now, so let me know if you want to go ahead with something like this 😁 !

PS: Also, I saw you trying to implement something to view the structures of the molecules in IPython. I think this will help: mols2grid.

bmcguir2 commented 3 years ago

Thanks for reaching out. spacetar looks awesome, and you're of course more than welcome to continue to scrape the astromol database for updated info and providing a very nice interface for folks!

The primary use case for astromol is for my own internal benefit in maintaining the Census article. As a result, I'd prefer to continue to development independently and at my own relatively slow pace.

If you have a specific feature request that would make scraping the database for updates easier (that doesn't involve a wholesale switch to an underlying database structure [that's on my to-do list, but it's reallllllly far down said list]), let me know and I'll try to work it into a future release.

astrogewgaw commented 3 years ago

@bmcguir2 no worries 😁 ! I can definitely understand why you would want to develop the project independently at your own pace, especially since it is directly linked to the Census. I think that in the long run, both projects can benefit from each other. I have already started looking into many of the features you have in mind for future releases of astromol, and I am going to try and implement some of those features in spacetar as well. If you or @laserkelvin have any ideas 💡 that you would like to see in spacetar (maybe because you can't put it into astromol for some reason), let me know by opening an issue 😄 !

I kind of have a favor to ask of both of you 😅 : could you spread the word about whoswho and spacetar through the astrochemical community? I am a bit of a nobody as far as the community is concerned, and I could really use their help and feedback on these projects. A bit of word-of-mouth publicity couldn't hurt, right?

If you need my help with anything here, let me know 👍🏾 !