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

Add sequencer.getSteps() #777

Merged
merged 4 commits into from
Feb 18, 2019
Merged

Add sequencer.getSteps() #777

merged 4 commits into from
Feb 18, 2019

Conversation

Divy123
Copy link
Member

@Divy123 Divy123 commented Feb 15, 2019

Fixes #251

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/reviewers and @publiclab/is-reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@Divy123
Copy link
Member Author

Divy123 commented Feb 15, 2019

@tech4GT @jywarren please review. I have added the getSteps() and a test for it. Since this is the start point, I want to make sure everything is good to go further.

@Divy123 Divy123 requested review from jywarren and tech4GT February 15, 2019 15:31
@@ -165,6 +165,22 @@ test('insertSteps({image: {index: index, name: "module", o: options} }) inserts
});


test('getSteps() returns correct array of steps', function(t){
var stepsOptionsName = ['load-image', 'channel', 'channel', 'channel', 'channel', 'channel'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

Why don't we do this with a new instance of ImageSequencer so that we can control the exact steps passed in, and it isn't interdependent on prior tests? What do you think?

And we can also add this to the README!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.
Thanks for the review.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@tech4GT tech4GT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi divy, the thing here is that we want to restructure this api in a way that the steps is not defined on the image but sequencer
I'll explain
Right now this function just creates an alias of sequencer.images.image1.steps but we want to make changes on the core such that sequencer.images.image1.steps does not exist but only sequencer.steps.
When that is done, out getSteps function will simply be

function getSteps(){
return sequencer.steps;
}

@Divy123
Copy link
Member Author

Divy123 commented Feb 16, 2019

Sure @tech4GT .
Actually since Warren said to first implement this part, I did this.
I was wondering this since the starting that after restructuring the API I have to again change the getSteps() accordingly as said by you.
So I would be working on this from now onwards.
Thanks!

@Divy123
Copy link
Member Author

Divy123 commented Feb 16, 2019

Also one more thing @tech4GT that is image-sequencer deployment from some branch other than main as the link for the demo on the repo is different than what we the contributors are seeing in our local versions?

@tech4GT
Copy link
Member

tech4GT commented Feb 16, 2019

Oh yes the gh-pages branch is what we deploy 😄

@jywarren
Copy link
Member

Yes I think we can do this first then restructure the internals in a separate PR. This looks good if someone else wants to approve too? And @Divy123 can you change the title to "add sequencer.getSteps()" so it's a bit more descriptive? Thanks!

@Divy123
Copy link
Member Author

Divy123 commented Feb 16, 2019

Yes I think we can do this first then restructure the internals in a separate PR. This looks good if someone else wants to approve too? And @Divy123 can you change the title to "add sequencer.getSteps()" so it's a bit more descriptive? Thanks!

By this, @jywarren do you mean I should first do the core API part right and then work on getSteps() ?
Thanks.

@jywarren
Copy link
Member

jywarren commented Feb 16, 2019 via email

@harshkhandeparkar harshkhandeparkar mentioned this pull request Feb 16, 2019
@Divy123 Divy123 changed the title Restructure Add sequencer.getSteps() Feb 16, 2019
@Divy123
Copy link
Member Author

Divy123 commented Feb 17, 2019

@jywarren please review.
I have made the said changes.
Thanks!

@jywarren jywarren merged commit c3abdaf into publiclab:main Feb 18, 2019
@jywarren
Copy link
Member

Awesome, great work!!

@Divy123 Divy123 deleted the restructure branch February 18, 2019 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants