Skip to content

Conversation

@hudi-hub
Copy link

  1. Both functions in the object_analysis module have a problem.
  • abundant function problem:
    for o in objects:
    if o['type'] == 'frb':
    sum_supernovae += 1
  • farthest function problem:
    o["redshift"] < highest_redshift
  1. Write a test for each function that demonstrates the problem.
  2. Fix the function and ensure the test passes.
  • correct function aboundant:
    for o in objects:
    if o['type'] == 'frb':
    sum_frbs += 1 # replace sum_supernovae by sum_frbs

  • correct farthest function:
    o["redshift"] > highest_redshift # replace < by >

@hudi-hub
Copy link
Author

Done steps 1, 2, 3

hudi-hub and others added 2 commits July 23, 2022 13:51
- Reduce the for loops, logical conditions, using modules and build-in functions.
@hudi-hub
Copy link
Author

"Performance improvement
"

@hudi-hub
Copy link
Author

update readme.md

@hudi-hub
Copy link
Author

Description added

@hudi-hub
Copy link
Author

Improve readability

@hudi-hub
Copy link
Author

auto test after each push

@hudi-hub
Copy link
Author

done final check, emailed back up code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant