-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from MotusWTS/beta3
Update master to motus v.3.1.0 # motus 3.1.0 ### Small Changes * Receiver downloads now have similar progress messages to Project downloads * Move GPS fields from `alltags` to `alltagsGPS` * New function `getGPS()` adds GPS fields to data * Remove NOT NULL constraint on `motusTagID`s in ambiguous tag view ### Bug fixes * Receivers updating to the new version errored on the download start * Allow renaming (if possible) of large databases on data updates * Continue checking for activity/nodeData even if first batch returns 0 * `nodeDataId` is corrected to `nodeDataID` * Warn users with custom views if they need to be removed prior to updating
- Loading branch information
Showing
143 changed files
with
2,791 additions
and
1,255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
^data-raw$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
RELEASE.R | ||
^RELEASE\.R$ | ||
^appveyor.yml$ | ||
^.*\SG-.*$ | ||
^.*project-4.motus$ | ||
^\.travis\.yml$ | ||
^codecov\.yml$ | ||
^LICENSE\.md$ | ||
^appveyor\.yml$ | ||
^codecov\.R$ | ||
^CODE_DESIGN\.md$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r | ||
|
||
language: R | ||
cache: packages | ||
|
||
script: | ||
- | | ||
R CMD build . | ||
travis_wait 20 R CMD check motus*tar.gz | ||
r_packages: | ||
- covr | ||
|
||
after_success: | ||
- travis_wait 20 Rscript codecov.R | ||
|
||
after_failure: | ||
- ./travis-tool.sh dump_logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# motus design principles | ||
|
||
This is a collection of developer notes and is by no means exhaustive or correct | ||
|
||
- [Naming Conventions](#naming-conventions) | ||
- [SQLite databases](#sqlite-databases) | ||
- [Special data downloads](#special-data-downloads) | ||
- [Special Files](#special-files) | ||
- [Data Files](#data-files) | ||
- [Testing](#testing) | ||
- [Adding and Updating](#adding-and-updating) | ||
|
||
## Naming Conventions | ||
- Each function in a single file | ||
- Exceptions | ||
- `utils.R` contains internal utility functions | ||
- `ensureDBTables.R` also contains `makeTable()` function to create tables | ||
- `updateMotusDb.R` also contains `checkViews()` function to check for custom views | ||
|
||
## SQLite databases | ||
- Empty SQLite tables created | ||
- `ensureDBTables()` checks for existing tables and creates empty tables if they | ||
don't exist | ||
- some tables are created with `makeTables()` | ||
- When changing the data base, the `checkVersion()` function compares the date | ||
in the `admInfo` table to the date in the internal data frame `sql_versions` | ||
- `sql_versions` is created in `./data-raw/updatesql.R` | ||
- If the database is out of date, `checkVersion()` applies the SQLite commands | ||
in the `sql_version` data frame to update the data base | ||
- Sometimes this involves making a temporary copy of a table, re-creating (with | ||
changes) the original table and then copying the data back. In these cases the | ||
table structure is created by the `makeTables()` function (so it can be used by | ||
`updatesql.R` as well as by `ensureDBTables()` without duplicating the process. | ||
- `checkDataVersion()` is used to update data versions (not database versions) | ||
|
||
## Special data downloads | ||
- Data that is downloaded by `batchID` after the main runs download | ||
- `pageDataByBatch()` is a function that sets up the process | ||
- `activity()` and `nodeData()` set the functions used to get going, but all is | ||
passed to `pageDataByBatch()` as the workhorse function | ||
|
||
## Special Files | ||
- `z.onLoad.R` | ||
- Set session variables (i.e., API links) and motus options | ||
(i.e. max batches to get when testing) | ||
- `Motus.R` - Define empty session variable (filled with `z.onLoad.R`) | ||
- `motus-pkg.R` - Help file documentation for the motus package | ||
|
||
## Data Files | ||
- Sample data for examples and testing, created in `./data-raw/sample_data.R` | ||
- INCOMPLETE | ||
- `updatesql.R` | ||
|
||
## Testing | ||
- `sample_auth()` is used for automatic tests involving the motus.sample project | ||
176 | ||
- `local_auth()` is used to load locally stored credentials for private projects | ||
to test local functionality | ||
- `skip_if_not_auth()` is used in tests to a) implement local authorizations if | ||
present and b) skip the test if they are not present | ||
|
||
`motusUpdateTagDB()` and `pageDataByBatch()` have checks in them that will halt | ||
a download after `getOption("motus.test.max")` batches IF in a testing | ||
environment. This way testing can be done much more quickly on a variety of | ||
projects/receivers. | ||
|
||
- `is_testing()` is an internal function that checks if a test is being run | ||
- `set_testing()` is an internal function for declaring that testing is being performed (for interactive testing, use `set_testing()` to start and `set_testing(set = FALSE)` to stop) | ||
|
||
## Adding and Updating | ||
|
||
### Adding a new field/column | ||
- Make change to `ensureDBTables()` | ||
- Add update to `data-raw/updatesql.R` (run script) | ||
- Add test to make sure new field is added | ||
- Update internal data `source("data-raw/sample_data.R")` | ||
- Push! | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.