Code Monkey home page Code Monkey logo

rgram's Introduction

Rgram

codecov R-CMD-check

The goal of Rgram is to make the image processing task easy and intuitive. With Rgram, users can rotate the image, convert it to greyscale, flip it horizontally in Black&White, and add padding to it (frame).

Installation

You can install the released version of Rgram from CRAN with:

install.packages("devtools")
devtools::install_github("UBC-MDS/"rgram")

Usage

This is a basic example which shows you how to solve a common problem:

library(Rgram)

  1. flipping(image)

Arguments:
- image: path to input image

  1. grayscale(image)

Arguments:
- image: path to input image\

  1. padding(image, width)

Arguments:
- image: path to input image
- width: number of pixels of padding to be added\

  1. rotate(image, degrees)

Arguments:
- image: path to input image
- degrees: the degrees to rotate the image by\

Documentation

vignette page

The help file can be viewed by:

?padding
?flipping
?rotate
?greyscale
#> No documentation for 'greyscale' in specified packages and libraries:
#> you could try '??greyscale'

rgram's People

Contributors

aishwaryagopal12 avatar jiajie0225 avatar mgaroub avatar wang-rui avatar

Watchers

 avatar  avatar

rgram's Issues

Create R repo and project structure

  • The name of the repository should be relevant to the package/project topics.

  • For now choose the MIT license. You may change it later when you learn more about licenses.

  • Use usethis::use_code_of_conduct to add a code of conduct. You may want to customize it further to suit your group.

  • Add the team members as authors to the DESCRIPTION file.

  • Use usethis::use_tidy_contributing() to add a CONTRIBUTING.md file to your package. This file will live in .github and it will create that folder if it does not already exist. Edit the boiler plate document this gives to to reflect your contribution strategy that your team has agreed upon.

Outline the package you would like to build in the README.Rmd file. (This can be identical for both projects at this point in the project). In particular, your README.md should contain:

  • a summary paragraph that describes the project at a high level

  • a bulleted list of the functions (and datasets if applicable) that will be included in the package (this should be a 1-2 sentence description for each function/dataset)

  • a paragraph describing where your packages fit into the R ecosystem (are there any other R packages that have the same/similar functionality? Provide links to any that do. If none exist, then clearly state this as well).

Flipping

Write test cases and code iteratively

Before writing any code, revisit your function specifications from last week and revise them if needed. As you do this, think critically about what function inputs you expect from the user and what your function is supposed to do (e.g., return).

Write a unit tests for each specified function using testthat. test_that code blocks do not need to be wrapped in a function. Each function should have 3 to 5 edge cases tested to ensure that the function returns what is expected to the user. Group these test cases in a sensible way so that what is being tested matches the string associated with the test_that code blocks. This might mean that you may end up with 2-3 test_that code blocks per function. Remember, when writing your tests, build them around your function specifications and requirements.

After writing your unit tests, write the internal code for your R functions.

Write function code and tests in close temporal proximity with each other. The process of writing function code and test cases will be iterative; there will be several rounds of writing tests → function improvement → writing more tests → function improvement → writing more tests → function improvement, etc.

Make sure that the tests cover all branches (e.g., if your function has an if statement, you should have tests where the if statement is true, and where the if statement is false.

As you develop your code and test cases, update your code documentation so that it makes sense with any of the changes you have made. Do not forget to also document your test functions.

Check whether the code passes all the unit tests you have written using the devtools::test() function.

Exception handling

The function should be written defensively. That is, it should handle incorrect input and errors detected during execution via throwing exceptions with useful error messages, and there should be tests to confirm that the exceptions result in the expected behaviour of the function.

Submission

The URL for each of your public projects’ repositories

The URL to a release for each of your projects’ repositories

The URL to the issue that thoroughly discusses and reasons the license choice

Submission

The URL for each of your your public projects’ repositories

The URL to a release for each of your projects’ repositories

a full usage demonstration

To do this, you should use vignette package-wide documentation in R, as well as the pkgdown R package to set up a website for your package.

include a full usage demonstration of all your package functions (this means a runnable example - give them data!) in your vignette

Function Specification

Complete the function specification for Rgram functions:

For this milestone you will write R function documentation that will serve as specifications, but you will NOT write any code for your package functions. Specifically, set-up empty functions (with appropriate function names) containing no code in the files where you will eventually write code. Write function documentation (e.g., complete roxygen2 comments). These are the functions you wrote about in your proposal.

Grayscale

Write test cases and code iteratively

Before writing any code, revisit your function specifications from last week and revise them if needed. As you do this, think critically about what function inputs you expect from the user and what your function is supposed to do (e.g., return).

Write a unit tests for each specified function using testthat. test_that code blocks do not need to be wrapped in a function. Each function should have 3 to 5 edge cases tested to ensure that the function returns what is expected to the user. Group these test cases in a sensible way so that what is being tested matches the string associated with the test_that code blocks. This might mean that you may end up with 2-3 test_that code blocks per function. Remember, when writing your tests, build them around your function specifications and requirements.

After writing your unit tests, write the internal code for your R functions.

Write function code and tests in close temporal proximity with each other. The process of writing function code and test cases will be iterative; there will be several rounds of writing tests → function improvement → writing more tests → function improvement → writing more tests → function improvement, etc.

Make sure that the tests cover all branches (e.g., if your function has an if statement, you should have tests where the if statement is true, and where the if statement is false.

As you develop your code and test cases, update your code documentation so that it makes sense with any of the changes you have made. Do not forget to also document your test functions.

Check whether the code passes all the unit tests you have written using the devtools::test() function.

Exception handling

The function should be written defensively. That is, it should handle incorrect input and errors detected during execution via throwing exceptions with useful error messages, and there should be tests to confirm that the exceptions result in the expected behaviour of the function.

initiate a review request for R and Python

Each team must initiate a review request by opening an issue per package in the UBC-MDS/software-review-2021 repository.

For initiating a reviewing request in R, use this template.

For initiating a reviewing request in Python, use the template under Submit Software for Review at this link.

(Details look at the milestone4 instruction)

Rotate

Write test cases and code iteratively

Before writing any code, revisit your function specifications from last week and revise them if needed. As you do this, think critically about what function inputs you expect from the user and what your function is supposed to do (e.g., return).

Write a unit tests for each specified function using testthat. test_that code blocks do not need to be wrapped in a function. Each function should have 3 to 5 edge cases tested to ensure that the function returns what is expected to the user. Group these test cases in a sensible way so that what is being tested matches the string associated with the test_that code blocks. This might mean that you may end up with 2-3 test_that code blocks per function. Remember, when writing your tests, build them around your function specifications and requirements.

After writing your unit tests, write the internal code for your R functions.

Write function code and tests in close temporal proximity with each other. The process of writing function code and test cases will be iterative; there will be several rounds of writing tests → function improvement → writing more tests → function improvement → writing more tests → function improvement, etc.

Make sure that the tests cover all branches (e.g., if your function has an if statement, you should have tests where the if statement is true, and where the if statement is false.

As you develop your code and test cases, update your code documentation so that it makes sense with any of the changes you have made. Do not forget to also document your test functions.

Check whether the code passes all the unit tests you have written using the devtools::test() function.

Exception handling

The function should be written defensively. That is, it should handle incorrect input and errors detected during execution via throwing exceptions with useful error messages, and there should be tests to confirm that the exceptions result in the expected behaviour of the function.

License Discussion

Examine the license for your project and consider whether this is the choice you want to make, or whether you want to change the license. Discuss and reason the license choice by opening issues in both Python and R repositories. As it is likely to be a very similar discussion for both projects, one of these issues can just link to the other issue where it is thoroughly dicussed.

Submission

Same as UBC-MDS/imageprocessor#22

In the textbox provided on Canvas for the Milestone 2 assignment you must include:

The URL for each of your your public projects’ reposioties

The URL to a release for each of your projects reposoitories

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.