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

v0.1.5 #19

Merged
merged 17 commits into from
Jul 11, 2023
Merged
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
^\.github$
^cran-comments\.md$
^CRAN-SUBMISSION$
^LICENSE\.md$
20 changes: 20 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generate codecov report
name: codecov-report
on: [workflow_dispatch]
jobs:
codecov:
name: Run codecov report
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup R
uses: r-lib/actions/setup-r@4e1feaf90520ec1215d1882fdddfe3411c08e492

- name: Install dependencies
run: Rscript -e "install.packages(c('remotes', 'rcmdcheck'))" -e "remotes::install_deps(dependencies = TRUE)"
- name: Test coverage
run: |
Rscript -e 'install.packages('covr')'
Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.1.1
Date: 2022-09-14 09:27:14 UTC
SHA: b4853ae3e1b63fb759d207c968a3ef172e26aba8
Version: 0.1.5
Date: 2023-07-11 17:46:17 UTC
SHA: 9ec79b76c77e17b8fb4bd4fadaa987d2a67a4fd4
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: VedicDateTime
Type: Package
Title: Vedic Calendar System
Version: 0.1.1
Version: 0.1.5
Authors@R: c(
person("Neeraj Dhanraj", "Bokde", , "neerajdhanraj@gmail.com", role = c("aut", "cre", "cph")),
person("Prajwal Kailasnath", "Patil", , "prajwalpatilcodes@gmail.com", role = "aut"),
Expand All @@ -17,10 +17,10 @@ Description: Provides platform for Vedic calendar system having several
Satish BD et al. (2013) <https:github.com/webresh/drik-panchanga>.
URL: https://www.neerajbokde.in/viggnette/2022-09-05-VedicDateTime
BugReports: https://github.com/prajwalkpatil/VedicDateTime/issues
License: GPL (>= 2)
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Depends: R (>= 3.1.0)
Suggests:
knitr,
Expand Down
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

595 changes: 595 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.1.5

* Added support for [`swephR>=0.3.1`](https://cran.r-project.org/web/packages/swephR/index.html). Additinal [#11 Github Issue](https://github.com/prajwalkpatil/VedicDateTime/issues/11)
* Updated test-cases
* Added support for older R release.

# v0.1.1

This is a re-submission based on reviews from [CRAN]
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ devtools::install_github("prajwalkpatil/VedicDateTime")
To build from source, clone the repository from Github

```r
devtools::build(args = c('--compact-vignettes=gs+qpdf'))
devtools::build(args = c('--compact-vignettes=both'))
devtools::install()
```
## R CMD CHECK
Expand All @@ -66,16 +66,16 @@ To check for CRAN submission

### `rhub`
```r
rhub::check_for_cran(check_args = c('--compact-vignettes=gs+qpdf'))
rhub::check_for_cran(check_args = c('--compact-vignettes=both'))
```
### Local - `R CMD CHECK`
```r
devtools::check(build_args = c('--compact-vignettes=gs+qpdf'))
devtools::check(build_args = c('--compact-vignettes=both'))
```

### Submit to CRAN
```r
devtools::release(args = c('--compact-vignettes=gs+qpdf'))
devtools::release(args = c('--compact-vignettes=both'))
```


Expand All @@ -86,6 +86,13 @@ To run the test cases for development
```r
devtools::test()
```
## Test Coverage

To generate the test coverage report cases for development

```r
covr::package_coverage("VedicDateTime")
```

## CRAN

Expand Down
1 change: 1 addition & 0 deletions VedicDateTime.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageBuildArgs: --compact-vignettes=both
PackageRoxygenize: rd,collate,namespace
15 changes: 7 additions & 8 deletions tests/test-report.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
ℹ Testing VedicDateTime
Error in install.packages : Updating loaded packages
✔ | F W S OK | Context
✔ | 1 | ahargana
✔ | 1 | gregorian_to_jd
✔ | 1 | jd_to_gregorian
✔ | 1 | karana
✔ | 1 | lagna
✔ | 1 | masa
✔ | 1 | moon_longtitude
✔ | 2 | moon_longtitude
✔ | 1 | moonrise
✔ | 1 | moonset
✔ | 1 | nakshatra
✔ | 2 | nakshatra
✔ | 1 | rashi
✔ | 1 | ritu
✔ | 1 | samvatsara
✔ | 1 | sun_longtitude
✔ | 1 | sunrise
✔ | 1 | sunset
✔ | 1 | tithi
✔ | 2 | tithi
✔ | 1 | vaara
✔ | 1 | yoga
✔ | 2 | yoga

══ Results ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 0.2 s
══ Results ═════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 1.1 s

[ FAIL 0 | WARN 0 | SKIP 0 | PASS 19 ]
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 23 ]
29 changes: 24 additions & 5 deletions tests/test_coverage.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
VedicDateTime Coverage: 70.37%
R/main.R: 35.63%
R/tithi.R: 81.48%
R/nakshatra.R: 81.82%
R/yoga.R: 85.29%
VedicDateTime Coverage: 68.67%
R/day_duration.R: 0.00%
R/from_dms.R: 0.00%
R/get_karana_name.R: 0.00%
R/get_lagna_name.R: 0.00%
R/get_masa_name.R: 0.00%
R/get_nakshatra_name.R: 0.00%
R/get_rashi_name.R: 0.00%
R/get_ritu_name.R: 0.00%
R/get_samvatsara_name.R: 0.00%
R/get_tithi_name.R: 0.00%
R/get_vaara_name.R: 0.00%
R/get_yoga_name.R: 0.00%
R/nakshatra.R: 75.00%
R/tithi.R: 75.86%
R/yoga.R: 80.56%
R/unwrap_angles.R: 85.71%
R/masa.R: 90.91%
R/inverse_lagrange.R: 91.67%
R/ahargana.R: 100.00%
R/elapsed_year.R: 100.00%
R/gregorian_to_jd.R: 100.00%
R/jd_to_gregorian.R: 100.00%
R/karana.R: 100.00%
R/lagna.R: 100.00%
R/lunar_phase.R: 100.00%
R/moon_longitude.R: 100.00%
R/moonrise.R: 100.00%
R/moonset.R: 100.00%
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test_moon_longtitude.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ library(VedicDateTime)
source_test_helpers()

test_that("Check positive testcase", {
skip_if(packageVersion("swephR") > "0.3.0", "New swephR version")
expect_equal(moon_longitude(vd$jd), 346.5715, tolerance = .Machine$double.eps^0.4)
expect_equal(moon_longitude(vd$jd), 346.5715, tolerance = .Machine$double.eps^0.2)
})
test_that("Check positive testcase", {
skip_if(packageVersion("swephR") < "0.3.1", "Old swephR version")
expect_equal(moon_longitude(vd$jd), 346.5713, tolerance = .Machine$double.eps^0.4)
expect_equal(moon_longitude(vd$jd), 346.5713, tolerance = .Machine$double.eps^0.2)
})
6 changes: 2 additions & 4 deletions tests/testthat/test_nakshatra.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ library(VedicDateTime)
source_test_helpers()

test_that("Check positive testcase", {
skip_if(packageVersion("swephR") > "0.3.0", "New swephR version")
expect_equal(nakshatra(vd$jd, vd$place), c(25,24,24,1), tolerance = .Machine$double.eps^0.4)
expect_equal(nakshatra(vd$jd, vd$place), c(25,24,24,3), tolerance = .Machine$double.eps^0.2)
})
test_that("Check positive testcase", {
skip_if(packageVersion("swephR") < "0.3.1", "Old swephR version")
expect_equal(nakshatra(vd$jd, vd$place), c(25,24,24,3), tolerance = .Machine$double.eps^0.4)
expect_equal(nakshatra(vd$jd, vd$place), c(25,24,24,3), tolerance = .Machine$double.eps^0.2)
})
6 changes: 2 additions & 4 deletions tests/testthat/test_tithi.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ library(VedicDateTime)
source_test_helpers()

test_that("Check positive testcase", {
skip_if(packageVersion("swephR") > "0.3.0", "New swephR version")
expect_equal(tithi(vd$jd, vd$place), c(20,20,55,35), tolerance = .Machine$double.eps^0.4)
expect_equal(tithi(vd$jd, vd$place), c(20,20,55,37), tolerance = .Machine$double.eps^0.2)
})
test_that("Check positive testcase", {
skip_if(packageVersion("swephR") < "0.3.1", "Old swephR version")
expect_equal(tithi(vd$jd, vd$place), c(20,20,55,37), tolerance = .Machine$double.eps^0.4)
expect_equal(tithi(vd$jd, vd$place), c(20,20,55,37), tolerance = .Machine$double.eps^0.2)
})
6 changes: 2 additions & 4 deletions tests/testthat/test_yoga.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ library(VedicDateTime)
source_test_helpers()

test_that("Check positive testcase", {
skip_if(packageVersion("swephR") > "0.3.0", "New swephR version")
expect_equal(yoga(vd$jd, vd$place), c(5,27,26,12), tolerance = .Machine$double.eps^0.4)
expect_equal(yoga(vd$jd, vd$place), c(5,27,26,14), tolerance = .Machine$double.eps^0.2)
})
test_that("Check positive testcase", {
skip_if(packageVersion("swephR") < "0.3.1", "Old swephR version")
expect_equal(yoga(vd$jd, vd$place), c(5,27,26,14), tolerance = .Machine$double.eps^0.4)
expect_equal(yoga(vd$jd, vd$place), c(5,27,26,14), tolerance = .Machine$double.eps^0.2)
})