Skip to content

Commit

Permalink
Fixed typos in generate.jl (#59)
Browse files Browse the repository at this point in the history
1. Get the positions of a frame by `positions(frame)` not the python way `frame.positions()`
2. The argument to the `UnitCell` method should be a vector of floats, not three integer numbers.
  • Loading branch information
Ruibin-Liu authored Mar 2, 2022
1 parent 08c5af5 commit f03b36d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ frame = Frame()
resize!(frame, 3)
set_topology!(frame, topology)

pos = frame.positions()
pos = positions(frame)
pos[1, :] = [1.0, 0.0, 0.0]
pos[2, :] = [0.0, 0.0, 0.0]
pos[3, :] = [0.0, 1.0, 0.0]
Expand All @@ -27,7 +27,7 @@ add_atom!(frame, Atom("O"), [7.0, 0.0, 0.0])
add_bond!(frame, 3, 4)
add_bond!(frame, 4, 5)

set_cell!(frame, UnitCell(10, 10, 10))
set_cell!(frame, UnitCell([10.0, 10.0, 10.0]))

Trajectory("water-co2.pdb", 'w') do trajectory
write(trajectory, frame)
Expand Down

0 comments on commit f03b36d

Please sign in to comment.