Skip to content

MSTIS Networks - #227

Merged
jhprinz merged 48 commits into
openpathsampling:masterfrom
dwhswenson:networks
May 17, 2015
Merged

jhprinz merged 48 commits into
openpathsampling:masterfrom
dwhswenson:networks

Conversation

@dwhswenson

Copy link
Copy Markdown
Member

Tasks:

  • Create 3-state toy model to test with
  • Function to join outer interfaces into single MS-outer interface
  • Tests for MS-outer interface
  • Build MSTISNetwork object
  • Run PathSampling calc based on MSTISNetwork.default_movers
  • Add storage for MSTISNetwork object

Tasks to be split into the next PR

  • Check MSTISNetwork sampling scheme
  • Test calculation of rate matrix with 3-state system
  • TISNetwork analysis routines

@dwhswenson dwhswenson self-assigned this Apr 24, 2015
@dwhswenson dwhswenson added this to the 1.0 milestone Apr 24, 2015
@dwhswenson dwhswenson mentioned this pull request Apr 24, 2015
4 tasks done
@dwhswenson dwhswenson changed the title MSTIS Networks [WIP] MSTIS Networks Apr 24, 2015
@dwhswenson

Copy link
Copy Markdown
Member Author

@jhprinz: I think I need your help finishing up the storage here. I thought storage was supposed to recursively save things; however, it doesn't seem to save the transitions in the MSTIS.from_state dictionary.

You'll be able to see very quickly if you've got it working by running the multistate_system_setup notebook followed by the mstis_analysis notebook. The output from the last cell in the latter should give information on all the transitions.

I tried to model the storage based on what we did for RETISTransition; that doesn't seem to be enough.

If you can issue a fix PR to my networks branch, then I'm only a few tests from calling this PR ready for review. Analysis aspects can come later.

@jhprinz

jhprinz commented May 11, 2015

Copy link
Copy Markdown
Contributor

on it...

@dwhswenson

Copy link
Copy Markdown
Member Author

@jhprinz : Still a small problem in storage. It looks like .name attributes aren't being saved if they're added separately.

All objects should have an optional .name attribute. If the user overrides the automatically-defined .name, then the name given by the user should be reconstructed (assuming the changed name was what was saved).

In principle, I know how to fix this class-by-class, but I'm hoping you can come up with a simpler global fix for this.

In the particular case I'm seeing, name isn't being saved for UnionVolume:

import openpathsampling as paths
storage = paths.storage.Storage("mstis.nc", mode="r")
mstis = storage.networks.load(0)
print mstis

errors with:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-84477e647a0d> in <module>()
----> 1 print mstis

/Users/dwhs/Dropbox/msm-tis/openpathsampling/analysis/network.pyc in __str__(self)
    209         mystr = "Multiple State TIS Network:\n"
    210         for state in self.from_state.keys():
--> 211             mystr += str(self.from_state[state])
    212         return mystr
    213 

/Users/dwhs/Dropbox/msm-tis/openpathsampling/analysis/tis_analysis.pyc in __str__(self)
    329         mystr = str(self.__class__.__name__) + ": " + str(self.name) + "\n"
    330         mystr += (str(self.stateA.name) + " -> " + str(self.stateA.name) 
--> 331                   + " or " + str(self.stateB.name) + "\n")
    332         for iface in self.interfaces:
    333             mystr += "Interface: " + str(iface.name) + "\n"

AttributeError: 'UnionVolume' object has no attribute 'name'

Whereas, if I run this in on the object before storage, I get the expected:

Multiple State TIS Network:
RETISTransition: Out C
C -> C or all states except C
Interface: 0.0<opC<0.04
Interface: 0.0<opC<0.09
Interface: 0.0<opC<0.16
RETISTransition: Out A
A -> A or all states except A
Interface: 0.0<opA<0.04
Interface: 0.0<opA<0.09
Interface: 0.0<opA<0.16
RETISTransition: Out B
B -> B or all states except B
Interface: 0.0<opB<0.04
Interface: 0.0<opB<0.09
Interface: 0.0<opB<0.16

Having this implemented properly will also help later when we get to #233.

@jhprinz

jhprinz commented May 12, 2015

Copy link
Copy Markdown
Contributor

Correct, the current handling of the .name attribute is not the best and I will find a better way and submit a PR today to get this working...

@dwhswenson dwhswenson modified the milestones: ASAP, 1.0 May 16, 2015
@dwhswenson

Copy link
Copy Markdown
Member Author

Everything seems to be saving and loading now! Let's call this one ready for review and merge; I'll start on the analysis aspects later.

@dwhswenson dwhswenson changed the title [WIP] MSTIS Networks MSTIS Networks May 17, 2015
@dwhswenson dwhswenson assigned jhprinz and unassigned dwhswenson May 17, 2015
@jhprinz

jhprinz commented May 17, 2015

Copy link
Copy Markdown
Contributor

great. merging...

jhprinz added a commit that referenced this pull request May 17, 2015
@jhprinz
jhprinz merged commit 3b0f016 into openpathsampling:master May 17, 2015
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.

2 participants