Comments (19)
@vreijs Sorry for the delay. I see there is meanwhile version 2.10 available. I guess it makes more sense to use that, right?
from swephr.
from swephr.
Let me know if you have any questions. BTW, with v2.10 I have the following failures in the tests:
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure (test-misc.R:22:5): deltat can be retrieved ─────────────────────────
swe_deltat(1234.567) not equal to 1.58738640540236.
1/1 mismatches
[1] 1.6 - 1.59 == 0.0103
── Failure (test-misc.R:29:5): deltat can be retrieved for vector ──────────────
swe_deltat(c(1234.567, 1234567)) not equal to c(1.5873864, 0.366039979375346).
2/2 mismatches (average diff: 0.0064)
[1] 1.598 - 1.587 == 0.0103
[2] 0.369 - 0.366 == 0.0025
── Failure (test-misc.R:72:5): version works ───────────────────────────────────
swe_version() not equal to "2.08".
1/1 mismatches
x[1]: "2.10"
y[1]: "2.08"
── Failure (test-misc.R:86:3): Determing ayanamsa using UT: ────────────────────
result$daya not equal to 24.99688.
1/1 mismatches
[1] 25 - 25 == -0.000115
── Failure (test-misc.R:94:3): Determing ayanamsa using ET: ────────────────────
result$daya not equal to 24.99688.
1/1 mismatches
[1] 25 - 25 == -0.000115
The first two differences are probably due to a deltaT update, right? The version change is also expected. Any idea about the last two changes?
from swephr.
from swephr.
from swephr.
from swephr.
from swephr.
I am not 100% sure, but the changes I introduced bring the deltaT tests without swephRdata in line with those with swephRdata installed: d7adf32
So I would like to do some more tests with this to make sure whether this comes from using version 2.10 or swephRdata being (not) present.
As for the compiler warnings:
libswe/sweph.c:2306:37: warning: ‘%s’ directive writing up to 255 bytes into a region of size 240 [-Wformat-overflow=]
libswe/sweph.c:2304:40: warning: ‘%s’ directive writing up to 255 bytes into a region of size 237 [-Wformat-overflow=]
libswe/sweph.c:2302:41: warning: ‘%s’ directive writing up to 255 bytes into a region of size 236 [-Wformat-overflow=]
libswe/sweph.c:2300:35: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 234 and 235 [-Wformat-overflow=]
libswe/sweph.c:2298:34: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 235 and 236 [-Wformat-overflow=]
libswe/sweph.c:2295:38: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 231 and 240 [-Wformat-overflow=]
Yes, it would be helpful to get input from the SE developers. These come from a portion of the code ( https://github.com/rstub/swephR/blob/feature/v2.10/external/src/sweph.c#L2295-L2306) where a new string s
is created based on a format and another string sp
. Unfortunately, both s
and sp
have the same max length and could therefor lead to an overflow. I had tried to use snprintf
instead of sprintf
, but this gives a "truncation" warning. In my current PR, I try to forcefully truncate sp
(cf a646c98) which works locally but not in the (new) CI (https://github.com/rstub/swephR/pull/60/checks?check_run_id=2494991210). One alternative would be to replace %s
with something like %.200s
, which again does work locally. I have not tried this on CI.
from swephr.
from swephr.
I do a difference with v2.08 depending on whether swephRdata
is installed or not. I don't see such a difference for v2.10.
v2.08 w/o swephRdata
ralf@barra:~/tmp$ R_LIBS_USER=~/tmp/R1 R -q -f swe-test.R
> library(swephR)
> swe_version()
[1] "2.08"
> requireNamespace("swephRdata")
Loading required namespace: swephRdata
Failed with error: ‘there is no package called ‘swephRdata’’
> swe_deltat(c(1234.567, 1234567))
[1] 1.587386 0.366040
v2.08 w/ swephRdata
ralf@barra:~/tmp$ R_LIBS_USER=~/tmp/R2 R -q -f swe-test.R
> library(swephR)
> swe_version()
[1] "2.08"
> requireNamespace("swephRdata")
> swe_deltat(c(1234.567, 1234567))
[1] 1.5976757 0.3685434
v2.10 w/o swephRdata
ralf@barra:~/tmp$ R_LIBS_USER=~/tmp/R3 R -q -f swe-test.R
> library(swephR)
> swe_version()
[1] "2.10"
> requireNamespace("swephRdata")
Loading required namespace: swephRdata
Failed with error: ‘there is no package called ‘swephRdata’’
> swe_deltat(c(1234.567, 1234567))
[1] 1.5976757 0.3685434
v2.10 w/o swephRdata
ralf@barra:~/tmp$ R -q -f swe-test.R
> library(swephR)
> swe_version()
[1] "2.10"
> requireNamespace("swephRdata")
> swe_deltat(c(1234.567, 1234567))
[1] 1.5976757 0.3685434
What would be the expected behavior here?
BTW, thanks for forwarding the suggestion from the SE developers, which does indeed work, cf https://github.com/rstub/swephR/pull/60/checks?check_run_id=2502228436
from swephr.
from swephr.
Using swe_deltat_ex
in the four different environments one can learn more about what is going on.
v2.08 w/o swephRdata
ralf@barra:~/tmp$ R_LIBS_USER=~/tmp/R1 R -q -f swe-test2.R
> library(swephR)
> swe_version()
[1] "2.08"
> requireNamespace("swephRdata")
Loading required namespace: swephRdata
Failed with error: ‘there is no package called ‘swephRdata’’
> swe_deltat_ex(c(1234.567, 1234567), 2)
$deltat
[1] 1.587386 0.366040
$serr
[1] "SwissEph file 'seplm48.se1' not found in PATH '/usr/local/lib/R/site-library/swephR/ephemeris/'"
[2] "SwissEph file 'seplm18.se1' not found in PATH '/usr/local/lib/R/site-library/swephR/ephemeris/' \nusing Moshier eph.; "
> swe_deltat_ex(c(1234.567, 1234567), 4)
$deltat
[1] 1.587386 0.366040
$serr
[1] "" ""
v2.08 w/ swephRdata
ralf@barra:~/tmp$ R_LIBS_USER=~/tmp/R2 R -q -f swe-test2.R
> library(swephR)
> swe_version()
[1] "2.08"
> requireNamespace("swephRdata")
> swe_deltat_ex(c(1234.567, 1234567), 2)
$deltat
[1] 1.5976757 0.3685434
$serr
[1] "" ""
> swe_deltat_ex(c(1234.567, 1234567), 4)
$deltat
[1] 1.587386 0.366040
$serr
[1] "" ""
v2.10 w/o swephRdata
ralf@barra:~/tmp$ R_LIBS_USER=~/tmp/R3 R -q -f swe-test2.R
> library(swephR)
> swe_version()
[1] "2.10"
> requireNamespace("swephRdata")
Loading required namespace: swephRdata
Failed with error: ‘there is no package called ‘swephRdata’’
> swe_deltat_ex(c(1234.567, 1234567), 2)
$deltat
[1] 1.5976757 0.3685434
$serr
[1] "" ""
> swe_deltat_ex(c(1234.567, 1234567), 4)
$deltat
[1] 1.587386 0.366040
$serr
[1] "" ""
v2.10 w/ swephRdata
ralf@barra:~/tmp$ R -q -f swe-test2.R
> library(swephR)
> swe_version()
[1] "2.10"
> requireNamespace("swephRdata")
> swe_deltat_ex(c(1234.567, 1234567), 2)
$deltat
[1] 1.5976757 0.3685434
$serr
[1] "" ""
> swe_deltat_ex(c(1234.567, 1234567), 4)
$deltat
[1] 1.587386 0.366040
$serr
[1] "" ""
So it seems like v2.10 no longer needs the SE data files for making deltaT computations using SE instead of Moshier. Is that expected? Or am I misinterpreting things here?
ea6546e also contains the removal of my previous attempt at fixing the new issue. The best reference are allways the files in external/patch
, in this case https://github.com/rstub/swephR/blob/ea6546eb004ff448cfac4951a9b3790222e884a0/external/patch/19_increase_buffer.diff.
BTW, thanks for telling me about v2.10.1. I will integrate this into this branch. Can you compile a list of changes since v2.08? I would like to add that to NEWS.md.
from swephr.
BTW, v2.10.1 brings in quite some changes, given that it is "only" a patch release:
- two source files are no longer used (
swepcalc.c
andswepdate.c
) - all other sources are now covered by AGPL and no longer GPL, even though
LICENSE
still refers to GPL
THe second point is no big issue for us, since swephR has always been covered by AGPL. But might be confusing for other users of the source code. Have the SE authors mentioned this change in any way?
from swephr.
Yet another BTW, the patch 19_increase_buffer.diff
is part of version 2.10.01.
from swephr.
from swephr.
from swephr.
Hi Victor,
Concerning AGPL: Excellent! You could ask the SE authors to also update the LICENSE
file in their distribution. For us this means we can get rid of the LICENSE
file and just say "AGPL" in DESCRIPTION
.
Concerning the two no longer used files: They are still part of the distribution (and are therefore still in external/src
), but they are no longer needed for building the library. That's why I have deleted them from src/libswe
. I see no need for the SE authors to take action, since there are other files in the distribution that are not needed to build the library.
I am curious to see what comes out of the deltaT discussion.
from swephr.
from swephr.
I am refering to the src/LICENSE
file in the source distribution:
[ralf@barra: ~/devel/swephR/external] [feature/v2.10 ↑·1|…6⚑ 2] ✔
08:31 $ tar xfO swe_unix_src_2.10.01.tar.gz src/LICENSE | head -n 20
/* Copyright (C) 1997 - 2008 Astrodienst AG, Switzerland. All rights reserved.
License conditions
------------------
This file is part of Swiss Ephemeris.
Swiss Ephemeris is distributed with NO WARRANTY OF ANY KIND. No author
or distributor accepts any responsibility for the consequences of using it,
or for whether it serves any particular purpose or works at all, unless he
or she says so in writing.
Swiss Ephemeris is made available by its authors under a dual licensing
system. The software developer, who uses any part of Swiss Ephemeris
in his or her software, must choose between one of the two license models,
which are
a) GNU public license version 2 or later
b) Swiss Ephemeris Professional License
The choice must be made before the software developer distributes software
from swephr.
Related Issues (20)
- Documentation HOT 11
- An error in swe_refrac_extended
- rhub builds HOT 4
- CRAN pre-test WARNING HOT 2
- Archived on CRAN HOT 7
- Some functions relevant for astrological usage HOT 18
- New WARNINGS from R devel HOT 1
- Too long lines in the manual
- New SE release 2.08 HOT 3
- Broken documentation links HOT 2
- Serious issue from CRAN checks HOT 9
- Understand and find ASAN errors HOT 5
- an error I frogot to mention HOT 2
- Julian Day to UTC HOT 2
- Travis failure with R devel
- Rcpp on macOS
- Cannot get swephR to use Swiss Ephemeris instead of Moshier HOT 16
- New WARN on CRAN HOT 10
- Add seorbel.txt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swephr.