mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
52 stars 33 forks source link

Where would be the best place to return CoreType Properties? #255

Open umesh-timalsina opened 4 years ago

umesh-timalsina commented 4 years ago

Related to #250 and #246, If we are to serialize a ForceField class or extract ForceField from various other properties. We need two things:

  1. For serailization, we need to parse units, group them by expressions and so forth?
  2. For forcefield extraction, we need various grouping strategies to perform an efficient export?

Where should these methods be? One example Let's say a DihedralType has periodic parameters as a list. Should the extraction of these parameters happen? The bigger picture is to reuse and don't rewrite/refactor later.

mattwthompson commented 4 years ago

My initial thoughts

parse units?

Yes, I would think so

group them by expressions

Not strictly necessary but this would be preferred; most core types of the same class are going to have the same expression

extract parameters

Yes, I would think so? At least I can't think of any other way.

I will also admit here that I'm still not 100% sure what serialization means. The criteria in my head is: "can I write this object to disk, read it back in, and have the same/same enough object back?" or, equivalently "can I read in this file, write it back out, and have something that is either the same or basically the same?"