ocean-tracking-network / glatos

9 stars 4 forks source link

`read_glatos_detections` coerces to data.table #200

Closed mhpob closed 10 months ago

mhpob commented 10 months ago

Tests for read_glatos_detections currently fail as the "correct" objects (data(walleye_detections) and data(lamprey_detections)) are of the class glatos_detections/data.frame, while importing a csv via read_glatos_detections returns a glatos_detections/data.table/data.frame regardless of input (data.frame, data.table, tibble).

Considering other functions attempt to conserve input class, is this the desired behavior?

mhpob commented 10 months ago

Tests for read_glatos_receivers also fail for a similar reason: data(sample_receivers) is not a data.table.

chrisholbrook commented 10 months ago

This is not the desired behavior; was introduced in v0.8.0.9000 as an unintended consequences of changes to as_glatos_detections and as_glatos_receivers. Fix will be pushed momentarily. Thanks @mhpob for the very helpful poke.

chrisholbrook commented 10 months ago

Fixed in v 0.8.0.9001 (7912d90d6bfb0dabfafdb2754851d42b55d1f92e).

All tests for read_glatos_detections and read_glatos_receivers are now passing; but are still warning that "context() was deprecated in the 3rd edition." see https://github.com/ocean-tracking-network/glatos/issues/201

chrisholbrook commented 10 months ago

@mhpob @jdpye Take a quick scan of https://github.com/ocean-tracking-network/glatos/commit/7912d90d6bfb0dabfafdb2754851d42b55d1f92e... I only changed a few lines in R/load-read_glatos_detections.r and R/load-read_glatos_receivers.r but git thinks every line was changed. But not in the other two files. Any idea why?

chrisholbrook commented 10 months ago

@mhpob @jdpye After I committed https://github.com/ocean-tracking-network/glatos/commit/7912d90d6bfb0dabfafdb2754851d42b55d1f92e, I then did a git pull and see this new "Style code (GHA)" commit (not made locally by me; authored by me on github?

image

mhpob commented 10 months ago

That's the "style" GH Action that was added with the R CMD check. Takes code and adds spacing, etc. for a consistent style.

It can be turned off by deleting the file at .github/workflows/style.yml

mhpob commented 10 months ago

Just looked -- the stylr action happens after your original commit with a separate commit and so shouldn't affect the original. No idea why git thought you changed everything.