The Wayback Machine - https://web.archive.org/web/20200716102612/https://github.com/kivy/kivy/issues/6739
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect sentence structure in Documentation #6739

Open
RinkuMonani opened this issue Feb 18, 2020 · 2 comments
Open

Incorrect sentence structure in Documentation #6739

RinkuMonani opened this issue Feb 18, 2020 · 2 comments

Comments

@RinkuMonani
Copy link

@RinkuMonani RinkuMonani commented Feb 18, 2020

I was reading the kivy documentation pdf (source: https://kivy.org/doc/stable/gettingstarted/) and i don't seem to qualify a line in section 9.2 Main loop as a valid sentence.

Section of Interest:

9.2.1 Scheduling a repetitive event
You can call a function or a method every X times per second using schedule_interval(). Here is
an example of calling a function named my_callback 30 times per second.

Description

"every X times per Second" is an incorrect structure.
Also, adjusting the word "every" elsewhere in the sentence doesn't match the function of schedule_interval().

Probable Correction:

9.2.1 Scheduling a repetitive event
You can call a function or a method X times per second using schedule_interval()

Please ignore if the line is intentional.
Thank You.

@tshirtman
Copy link
Member

@tshirtman tshirtman commented Feb 18, 2020

https://kivy.org/doc/stable/guide/events.html?highlight=scheduling%20repetitive%20event#scheduling-a-repetitive-event
indeed it's incorrect, as the api allows to execute every time x seconds pass, i think it would be misleading to correct the way you proposed, but we can indeed improve the wording, i would propose "you can call a function or method every x seconds".

@RinkuMonani
Copy link
Author

@RinkuMonani RinkuMonani commented Feb 18, 2020

if  "the api allows to execute every time x seconds pass" then probably the given example needs to change too.

The correction I suggested was made out of the example mentioned in that section.
It says: "Here is an example of calling a function named my_callback 30 times per second: "
    
What I make out of  "the api allows to execute every time x seconds pass" is that if I pass 2 for variable X, then my function will be called repeatedly at every 2 seconds; which is not very clear from the example, for beginners atleast.

I suggest an additional line at the end of that example : Here my_callback() will be called every time 1/30 seconds pass (i.e, 30 times per second)

Edit:

You can call a function or a method at specified intervals using schedule_interval(). Here is an example of calling a function named my_callback 30 times per second:
def my_callback(dt):      
print 'My callback is called',dt
event = Clock.schedule_interval(my_callback, 1 / 30.)  
Here my_callback will be called everytime 1/30 seconds pass (i.e, 30 times per second)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.