Skip to content

Commit

Permalink
Remove shiny/BrownDog
Browse files Browse the repository at this point in the history
Removed other instances of Browndog from `*.Rmd` and addSecrets.R

Signed-off-by: Abhinav Pandey <[email protected]>
  • Loading branch information
Sweetdevil144 committed Aug 8, 2024
1 parent 59200c6 commit 71bc32c
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 431 deletions.
13 changes: 0 additions & 13 deletions base/settings/R/addSecrets.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ addSecrets <- function(settings, force = FALSE) {
}
}

# only copy these sections if tag exists
for (key in c("browndog")) {
if (! key %in% names(settings)) next

for (section in names(pecan[[key]])) {
if (section %in% names(settings[section])) {
PEcAn.logger::logger.info("Already have a section for", section)
} else {
PEcAn.logger::logger.info("Imported section for", section)
settings[[key]][section] <- pecan[[key]][section]
}
}
}

return(invisible(settings))
}
29 changes: 0 additions & 29 deletions base/settings/tests/testthat/test.addSecrets.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,3 @@ test_that("`addSecrets` adds secret settings when force is TRUE and secrets have
expect_equal(updated_settings$database$section$name, "pecan")
expect_equal(updated_settings$database$section$password, "pecan")
})

test_that("`addSecrets` adds secret settings when force is FALSE and secrets have not been added", {
settings <- list(
settings.info = list(
secrets.added = FALSE
),
browndog = list()
)

mocked_xmlToList_result <- list(
database = list(
section = list(
name = "pecan",
password = "pecan"
)
),
browndog = list(
section = list(
name = "pecan"
)
)
)
mockery::stub(addSecrets, 'file.exists', TRUE)
mockery::stub(addSecrets, 'xmlToList', mocked_xmlToList_result)
updated_settings <- addSecrets(settings, force = FALSE)
expect_equal(updated_settings$database$section$name, "pecan")
expect_equal(updated_settings$database$section$password, "pecan")
expect_equal(updated_settings$browndog$section$name, "pecan")
})
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ sensitivity=-1,1
pecan_edit=on
# redirect to edit the model configuration files
model_edit=on
# use browndog
browndog=on
```

For example the following will run the above workflow. Using -v in curl will show verbose output (needed) and the grep will make sure it only shows the redirect. This will show the actual workflowid:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This section will provide information to those wanting to take advantage of PEcAn's customizations from the web interface.

* [Additional web configuration] - Advanced options available from the web interface
- [Brown Dog](#browndog)
- [Sensitivity and ensemble analyses][Advanced Setup][TODO: Under construction...]
- [Editing model configurations][TODO: Under construction...]
* [Settings-configured analyses] - Analyses only available by manually editing `pecan.xml`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Additional settings for web configuration:

- [Web interface setup]{#intermediate-web-setup}
- [Brown Dog]{#browndog}
- [Advanced setup]{#intermediate-advanced-setup}
- [Sensitivity analysis] (TODO)
- [Uncertainty analysis] (TODO)
Expand All @@ -19,26 +18,16 @@ The list of configuration available

1. **Database configuration** : BETYdb(Biofuel Ecophysiological Traits and Yields database) configuration details, can be edited according to need.

2. **Browndog configuration** : Browndog configuration details, Used to connect browndog. Its included by default in VM.
2. **FIA Database** : FIA(Forest Inventory and Analysis) Database configuration details, Can be used to add additional data to models.

3. **FIA Database** : FIA(Forest Inventory and Analysis) Database configuration details, Can be used to add additional data to models.
3. **Google MapKey** : Google Map key, used to access the google map by PEcAn.

4. **Google MapKey** : Google Map key, used to access the google map by PEcAn.
4. **Change Password** : A small infomation to change the VM user password. (if using Docker image it won't work)

5. **Change Password** : A small infomation to change the VM user password. (if using Docker image it won't work)

6. **Automatic Sync** : If ON then it will sync the database between local machine and the remote servers. **Still unders testing part might be buggy**.
5. **Automatic Sync** : If ON then it will sync the database between local machine and the remote servers. **Still unders testing part might be buggy**.

Still work on the adding other editing feature going on, this page will be updated as new configuration will be available.

### Brown Dog {#browndog}

The Browndog service provides PEcAn with access to large and diverse sets of data at the click of a button in the format that PEcAn needs. By clicking the checkbox you will be using the Browndog Service to process data.

For more information regarding meteorological data check out [Available Meteorological Drivers](#met-drivers).

More information can be found at the [Browndog website](http://browndog.ncsa.illinois.edu/).

### Advanced Setup {#intermediate-advanced-setup}

(TODO: Under construction...)
Expand Down
22 changes: 0 additions & 22 deletions book_source/03_topical_pages/03_pecan_xml.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ It contains the following major sections ("nodes"):
- [`parameter.data.assimilation`](#xml-parameter-data-assimilation) -- Parameter data assimilation
- [`multi.settings`](#xml-multi-settings) -- Multi Site Settings
- (experimental) [`state.data.assimilation`](#xml-state-data-assimilation) -- State data assimilation
- (experimental) [`browndog`](#xml-browndog) -- Brown Dog configuration
- (experimental) [`benchmarking`](#xml-benchmarking) -- Benchmarking
- [`remote_process`](#xml-remote_process) -- Remote data module

Expand Down Expand Up @@ -972,27 +971,6 @@ For the MODIS LAI and SMAP soil moisture observations, the `search_window` speci
* **run_parallel** : [optional] This tag defines if you want to proceed the MODIS LAI function parallely, the default value is FALSE.


### (experimental) Brown Dog {#xml-browndog}

This section describes how to connect to [Brown Dog](http://browndog.ncsa.illinois.edu). This facilitates processing and conversions of data.

```xml
<browndog>
<url>...</url>
<username>...</username>
<password>...</password>
</browndog>
```

* `url`: (required) endpoint for Brown Dog to be used.
* `username`: (optional) username to be used with the endpoint for Brown Dog.
* `password`: (optional) password to be used with the endpoint for Brown Dog.

This information is currently used by the following R functions:

- `PEcAn.data.atmosphere::met.process` -- Generic function for processing meteorological input data.
- `PEcAn.benchmark::load_data` -- Generic, versatile function for loading data in various formats.

### (experimental) Benchmarking {#xml-benchmarking}

Coming soon...
Expand Down
4 changes: 1 addition & 3 deletions book_source/03_topical_pages/11_adding_to_pecan.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,7 @@ This information is stored in a Format record in the bety database. Make sure to
If the Format you are looking for is not available, you will need to create a new record. Before entering information into the database, you need to be able to answer the following questions about your data:

- What is the file MIME type?
- We have a suit of functions for loading in data in open formats such as CSV, txt, netCDF, etc.
- PEcAn has partnered with the [NCSA BrownDog project](http://browndog.ncsa.illinois.edu/) to create a service that can read and convert as many data formats as possible. If your file type is less common or a proprietary type, you can use the [BrownDog DAP](http://dap.ncsa.illinois.edu/) to convert it to a format that can be used with PEcAn.
- If BrownDog cannot convert your data, you will need to contact us about writing a data specific load function.
- We have a suit of functions for loading in data in open formats such as CSV, txt, netCDF, etc.

- What variables does the file contain?
- What are the variables named?
Expand Down
14 changes: 0 additions & 14 deletions modules/benchmark/R/load_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ load_data <- function(data.path, format, start_year = NA, end_year = NA, site =
fcn <- match.fun(fcn1)
} else if (exists(fcn2)) {
fcn <- match.fun(fcn2)
} else if (!exists(fcn1) & !exists(fcn2) & requireNamespace("BrownDog", quietly = TRUE)) {
#To Do: call to DAP to see if conversion to csv is possible
#Brown Dog API call through BDFiddle, requires username and password
key <- BrownDog::get_key("https://bd-api.ncsa.illinois.edu",username,password)
token <- BrownDog::get_token("https://bd-api.ncsa.illinois.edu",key)
#output_path = where are we putting converted file?
converted.data.path <- BrownDog::convert_file(url = "https://bd-api.ncsa.illinois.edu", input_filename = data.path,
output = "csv", output_path = output_path, token = token)
if (is.na(converted.data.path)){
PEcAn.logger::logger.error("Converted file was not returned from Brown Dog")
}
#not doing anything about mimetypes not convertible by BD right now
fcn <- match.fun("load_csv")
data.path <- converted.data.path
} else {
PEcAn.logger::logger.warn("Brown Dog is currently unable to perform conversion from ",mimetype," to a PEcAn usable format")
}
Expand Down
12 changes: 0 additions & 12 deletions shiny/BrownDog/DESCRIPTION

This file was deleted.

34 changes: 0 additions & 34 deletions shiny/BrownDog/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion shiny/BrownDog/README.md

This file was deleted.

Loading

0 comments on commit 71bc32c

Please sign in to comment.