Code Monkey home page Code Monkey logo

Comments (5)

peastman avatar peastman commented on August 29, 2024 1

# Use a comma to define related things close together

I find the former clearer, since it doesn't separate the name sigma from the value you're assigning to it. In fact, I'd split this into two lines:

sigma = 3.4*unit.angstrom
epsilon = 0.238*unit.kilocalories_per_mole

# use f-string formatting, print the current state number, and take care of starting at 0 and not 1
print(f"state {k} / {nstates-1} iteration {iteration} / {niterations-1}")

Agreed about the formatting, not about the -1. If you print "state 0 / 9", that indicates there are 9 states when in fact there are 10.

from openmm-org.

raimis avatar raimis commented on August 29, 2024

@mikemhenry thanks for your interest! The tutorials would definitely benefit from some updates and clean up.

I think that we don't need so much comment about the language features. If they want to learn Python, there are better tutorial for that.

# Use a comma to define related things close together 
# use f-string formatting, print the current state number, and take care of starting at 0 and not 1

Also, keep in mind, there are more tutorials (#25). At some point, we may convert these one to Jupyter notebooks too.

from openmm-org.

mikemhenry avatar mikemhenry commented on August 29, 2024

Sounds good! I'll take a pass at things and I really appreciate the feedback!

There are 10 states when going 0 to 9, what looks weird is when the loops end like:

9/10
0/10

I think most people would expect an iteration to look like

9/9
0/9

or

10/10
1/10

from openmm-org.

mikemhenry avatar mikemhenry commented on August 29, 2024

@mikemhenry thanks for your interest! The tutorials would definitely benefit from some updates and clean up.

I think that we don't need so much comment about the language features. If they want to learn Python, there are better tutorial for that.

# Use a comma to define related things close together 
# use f-string formatting, print the current state number, and take care of starting at 0 and not 1

Also, keep in mind, there are more tutorials (#25). At some point, we may convert these one to Jupyter notebooks too.

That is a good point, I'll focus on the scripts so that if we decide to switch to notebooks we can import the code so we don't need to copy and paste/maintain it in two locations. If we don't end up doing it by the time we are happy with the tutorials then I'll split things up and copy it back into index.md

PR opened #47

from openmm-org.

peastman avatar peastman commented on August 29, 2024

Adding 1 to k instead of subtracting 1 from nstates seems clearest. That way it counts from 1/10 up to 10/10.

from openmm-org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.