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

v1.0.0 update with ES6 modules + more #22

Closed
wants to merge 57 commits into from

Conversation

0xStarcat
Copy link

@0xStarcat 0xStarcat commented Oct 6, 2019

(moved this PR to #23 to change head repo branches)

v1.0.0

Fixed
  • Fixed Moon phaseQuarter bug where integer did not align with expected moon phase start.
Added
  • Added phaseQuarterString property to the moon result with a descriptor of the phase ("Full Moon", etc).
  • Complete test coverage for all calculated bodies.
Changed
  • Refactors much of the codebase into ES6 modules, classes, and OOP patterns where easy to do.
  • body.constellation property returns the name of the constellation instead of the index
Breaking Changes
  • Added Ephemeris class to access calculations (see README for usage examples)
  • Requires month range 0 - 11 on instantiation

@0xStarcat
Copy link
Author

0xStarcat commented Oct 6, 2019

Hi! I'm Jade.

I have a fork where I've been working on an ES6 implementation of this package. I just released a 1.0.0 version and I'd like to merge it with library if you'd like.

There are a couple of major changes with how it's implemented (hence the 1.0.0 designation).

Now the ephemeris is constructed from a class like so:

(note - the input months are now 0 - 11 to align with javascript standards)

import Ephemeris from './build/ephemeris-1.0.0.bundle.js'

// January 1, 2000 UTC - cambridge, MA
const ephemeris = new Ephemeris({
  year: 2000, month: 0, day: 1, hours: 0, minutes: 0, latitude: 41.37, longitude: -71.1
})

Full implementation details are in the README of the fork: https://github.com/0xStarcat/Moshier-Ephemeris-JS

I've also made some updates to the results object, such as fixing the way the moon phase is reported, adding a phaseQuarterString property, and changing constellation to return a string name of the constellation instead of an arbitrary index number.

The calculated bodies are completely covered by tests so I was able to catch any deviations that occured from the 0.1.0 version while I did my refactors. I noted the corrections that I preserved in the README and believe my refactors may have fixed a bug or 2.

Refactors were done to implement ES6 modules and object oriented programming patterns in the codebase. Much of the codebase still needs refactoring, but I figured most of the major work is done and this can be done later.

I'd love to hear what you think and I invite you to run the tests yourself and view the new demo in your browser (demo/index.html) in my fork.

Thank you!
Jade

@0xStarcat
Copy link
Author

should also address #21 and #16

@0xStarcat
Copy link
Author

Closing PR to open #23 which uses a locked 1.0.0 branch from my repo.

@0xStarcat 0xStarcat closed this Oct 10, 2019
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