Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions participants/WujiWang-astro/AHW_PR_tutorial.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Metadata-Version: 2.1
Name: AHW-PR-tutorial
Version: 0.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
setup.py
AHW_PR_tutorial.egg-info/PKG-INFO
AHW_PR_tutorial.egg-info/SOURCES.txt
AHW_PR_tutorial.egg-info/dependency_links.txt
AHW_PR_tutorial.egg-info/top_level.txt
pr_tutorial/__init__.py
pr_tutorial/buggy_function.py
pr_tutorial/simple_functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pr_tutorial
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import math


def angle_to_sexigesimal(angle_in_degrees, decimals=3):
"""
Convert the given angle to a sexigesimal string of hours of RA.

Parameters
----------
angle_in_degrees : float
A scalar angle, expressed in degrees

Returns
-------
hms_str : str
The sexigesimal string giving the hours, minutes, and seconds of RA for
the given `angle_in_degrees`

"""
if math.floor(decimals) != decimals:
raise OSError('decimals should be an integer!')

hours_num = angle_in_degrees*24/180
hours = math.floor(hours_num)

min_num = (hours_num - hours)*60
minutes = math.floor(min_num)

seconds = (min_num - minutes)*60

format_string = '{}:{}:{:.' + str(decimals) + 'f}'
return format_string.format(hours, minutes, seconds)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def fibonacci(max):
values = [0, 1]
while values[-2] + values[-1] < max:
values.append(values[-2] + values[-1])
return values


def factorial(value):
if value == 0:
return 1
else:
return value * factorial(value - 1)
11 changes: 6 additions & 5 deletions participants/WujiWang-astro/doc/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Ok so I guess you are reading this cuz you wanna use my code. There are some
functions that do stuf and thats:
**Tutorial README code**

Ok so I guess you are reading this because you wanna use my code. There are examples what funcitons will do:

>>> from simple_functions import factorial
>>> factorial(10)
9
10!

and this other part does something. I forget why that I did it:
Generate Fibonnacci array:

>>> fibonnaccci(100)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

If you can't use it, its kind of your problem, not mine!
Updated by Wuji.
Binary file not shown.