Giter Club home page Giter Club logo

rndop's People

Contributors

jlacko avatar kalab-oto avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jlacko petrbalej

rndop's Issues

Numbers of records differ from web app

Numbers of filtered records in web app is differs from that returned by ndop_download using both spcies and families.

Bug reported by mail:

Kolik je v databázi : Kolik se stáhne při stáhnutí daného druhu : Kolik se stáhne, pokud stáhneš čeleď a pak filtruješ
Coenonympha pamphilus: 31195 : 31627 : 31734
Když vyfiltruješ daný druh po stáhnutí celé čeledi
Thymelicus lineola → 20978: Hesperiidae → 13268
Polyommatus icarus → 28308: Lycaenidae → 29826
Plebejus argus → 7407: Lycaenidae → 7747
Melitaea athalia → 9726: Nymphalidae → 9796
Melanargia galathea → 20978: Nymphalidae → 22874
Maniola jurtina → 33724: Nymphalidae → 22874
Coenonympha arcania → 6360: Nymphalidae → 6469
Coenonympha glycerion → 9925: Nymphalidae → 9974

crash with too many records queried

Let the user know about crashes on the web filter side with printing message from webside (filter_page)

e.g.
<tr><td colspan="2"><ul style="color: red;"><li>Filtr vrací příliš mnoho výsledků, upřesněte prosím podmínky.</li></ul></td></tr> <tr>

iterative ndop_search and table download

Clean up the ndop_download() funciton after #8 and #9, and think of a way to run iterative search_payload, ndop_search and table download (for loop). This will allow more options for #10 and #2.

Test if ndop_search and table download can be iterated separately, with ndop_search returning list of tokens ndtoken. This helps with counting total number of occurrences in iterations.

query with spatial objects

Define argument in ndop_downlad.R to pass sf polygon object, than reformat geometry to search payload.

Error in downloading some spceies

Bug reported by mail

Some species can't be downloaded while can be filtered, and returns occurrences in web app

Thymelicus lineola
Polyommatus icarus
Plebejus argus
Melitaea athalia
Melanargia galathea
Maniola jurtina
Coenonympha arcania
Coenonympha glycerion 
Error in vector("list", length = tables_num) : vector size cannot be NA/NaN

modified output table - dwc

The raw table from NDOP should be translated and modified (e.g, DATUM_OD). This will probably follow the Darwin Core standard.

The raw data will be still available with ndop_download argument raw = True, so this argument will need to be added in established processes.

enable overwrite login and password with 'isop_login'

If the login is once stored in .Renviron it can't be changed with isop_login(). This disable to enter new user, or new password if changed.
Possible fix: add argument which deletes the username and password from .Renviron and promt for new credentials

fix the double request workaround

The first request after login returns empty results. Fix this workaround. Try add checking the page in isop_login() function.

rndop/R/ndop_search.R

Lines 61 to 66 in b77af84

for (i in 1:2){
filter_page <- httr::POST(SEARCH_URL,
body = search_payload,
config = httr::set_cookies(
isop_loginhash = isop_loginhash))
}

Handle 0 records in one spceis If more species found

Bug reported by mail:

If promted string (e.g. species name) are in multiple values in database, and one of them has 0, none of them are downloaded (counts as 0 records). Similar case as #4.

Processing 2 species: Plebejus argus, Plebejus argus/argyrognomon,NA records found

Downloading more species in one query

As we know, when you want to download more species in one query you do something like this:

species <- ndop_download("Lutra lutra || Glis glis" ) That is great, but trouble kicks in, when you have to download for example 50 species and one species has 0 records. The process failed and you have no idea what species specifically has 0 records.

So what I came with this pretty easy solution (maybe not the fastest one):

species <- c(Lutra lutra" , "Glis glis")  #vector of species names

final_table <- data.frame()  #empty data frame to catch result

for (i in species){
  print(i) #print ongoing species
  result <- ndop_download(i) 
  final_table <- rbind(final_table , result ) #row bind restult
} 
 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.