Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

issues using w_ipa

25 views
Skip to first unread message

Chloe Sheen

unread,
Nov 13, 2023, 6:42:58 PM11/13/23
to westpa-users
Hi WESTPA users,

I've been attempting to use the w_ipa tool on westpa-2020.05 and have run into the ValueError: coordinate value out of bin space error that I have not been able to figure out. I have a 2-dimensional binning scheme, and none of my replicates in the run have a pcoord greater than 18. Here's the binning scheme:

        dim1 = numpy.array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])
        dim2 = numpy.array([0,1,2])
        self.bin_mapper   = RectilinearBinMapper([dim1,dim2])

Here are the lines in my west.cfg that seems to cause this issue when I run w_ipa:

        TEST:
          enabled: True
          bins:
            - type: RectilinearBinMapper
              boundaries:
                - [0, 18.0, 'inf']
                - [0, 1, 2]
          states:
            - label: unfolded
              coords:
                - [0, 18.0]
                - [0, 0]
            - label: folded
              coords:
                - [0, 18.0]
                - [1, 1]

I only care about the second dimension of the progress coordinate to define the states. Using w_ipa on a similar setup in my west.cfg has worked previously, though my pcoord values were floats between 0 and 1 versus my now integer pcoord values between 0 and 18. 

When I run w_ipa, this is the error: ValueError: coordinate value 18.0 is out of bin space in dimension 1.
When I run w_ipa --debug, this is the error:   File "/home/csheen/anaconda3/envs/westpa-openmm/westpa-2020.06/lib/west_tools/w_ipa.py", line 156, in hash_args
    print('arg {num:02d} -- {arg:<20}'.format(num=il+iarg, arg=l))
TypeError: unsupported format string passed to bytes.__format__

I also tried playing around with the state boundaries and was able to get around the error when I use a small value like [0,1.5] instead of [0,18] in the first dimension. But that's not quite what I want since I want to consider any value in the first dimension. 

Is the way that I'm defining boundaries in west.cfg wrong?

Thank you,
Chloe

Jeremy Leung

unread,
Nov 13, 2023, 6:53:43 PM11/13/23
to westpa-users
Hi Chloe, 

When you're defining states, each bullet point should be [1st dim, 2nd dim] to specify a point in each bin. [0, 18] is outside your bin because your 2nd dimension is between 0 to 2. I'm assuming you want something like this instead?

      TEST:
          enabled: True
          bins:
            - type: RectilinearBinMapper
              boundaries:
                - [0, 18.0, 'inf']
                - [0, 1, 2]
          states:
            - label: unfolded
              coords:
                - [0, 0]
                - [18, 0]
            - label: folded
              coords:
                - [0, 1]
                - [18, 1]


And by the way, bin boundaries follow the Python convention so each bin is [inclusive, exclusive). So if you have something landing exactly on the boundary it gets counted to the bin which is ≥ bin boundary.

Useful Links:

-- JL
Reply all
Reply to author
Forward
0 new messages