def get_dispName_for_writemmp(display): #bruce 080324, revised 080328 """ Turn a display-style code integer (e.g. diDEFAULT; as stored in Atom.display or Chunk.display) into a display-style code string as used in the current writing format for mmp files. """ if debug_pref_write_new_display_names(): return new_dispNames[display] return dispNames[display]
def write_header(self): assy = self.assy # The MMP File Format is initialized here, just before we write the file. # Mark 050130 # [see also the general notes and history of the mmpformat, # in a comment or docstring near the top of this file -- bruce 050217] from utilities.GlobalPreferences import debug_pref_write_new_display_names if self.write_bonds_compactly: # soon, this will become the usual case, I hope mmpformat = MMP_FORMAT_VERSION_TO_WRITE__WITH_COMPACT_BONDS_AND_NEW_DISPLAY_NAMES elif debug_pref_write_new_display_names(): # this is what will be used by default in NE1 1.0.0, # as it turned on by default as of now, for writing to all mmp files # (whether intended for NE1 or NV1; doesn't affect files for ND1) # [bruce 080410] mmpformat = MMP_FORMAT_VERSION_TO_WRITE__WITH_NEW_DISPLAY_NAMES else: # this case is needed as long as some readers don't yet support # the new display names (an incompatible change), or if we want # to retain the ability to write files for older reading code # such as A9.1 or prior releases. mmpformat = MMP_FORMAT_VERSION_TO_WRITE if not (self.sim or self.min): #bruce 050322 comment: this side effect is questionable when # self.sim or self.min is True. #bruce 080328: don't do it then (since it's possible we might soon # write a different version of this record then). assy.mmpformat = mmpformat self.fp.write("mmpformat %s\n" % mmpformat) if self.min: self.fp.write( "# mmp file written by Adjust or Minimize; can't be read before Alpha5\n" ) elif self.sim: self.fp.write( "# mmp file written by Simulate; can't be read before Alpha5\n" ) if not self.min: self.fp.write("kelvin %d\n" % assy.temperature) # To be added for Beta. Mark 05-01-16 ## f.write("movie_id %d\n" % assy.movieID) return
def write_header(self): assy = self.assy # The MMP File Format is initialized here, just before we write the file. # Mark 050130 # [see also the general notes and history of the mmpformat, # in a comment or docstring near the top of this file -- bruce 050217] from utilities.GlobalPreferences import debug_pref_write_new_display_names if self.write_bonds_compactly: # soon, this will become the usual case, I hope mmpformat = MMP_FORMAT_VERSION_TO_WRITE__WITH_COMPACT_BONDS_AND_NEW_DISPLAY_NAMES elif debug_pref_write_new_display_names(): # this is what will be used by default in NE1 1.0.0, # as it turned on by default as of now, for writing to all mmp files # (whether intended for NE1 or NV1; doesn't affect files for ND1) # [bruce 080410] mmpformat = MMP_FORMAT_VERSION_TO_WRITE__WITH_NEW_DISPLAY_NAMES else: # this case is needed as long as some readers don't yet support # the new display names (an incompatible change), or if we want # to retain the ability to write files for older reading code # such as A9.1 or prior releases. mmpformat = MMP_FORMAT_VERSION_TO_WRITE if not (self.sim or self.min): # bruce 050322 comment: this side effect is questionable when # self.sim or self.min is True. # bruce 080328: don't do it then (since it's possible we might soon # write a different version of this record then). assy.mmpformat = mmpformat self.fp.write("mmpformat %s\n" % mmpformat) if self.min: self.fp.write("# mmp file written by Adjust or Minimize; can't be read before Alpha5\n") elif self.sim: self.fp.write("# mmp file written by Simulate; can't be read before Alpha5\n") if not self.min: self.fp.write("kelvin %d\n" % assy.temperature) # To be added for Beta. Mark 05-01-16 ## f.write("movie_id %d\n" % assy.movieID) return