Code Monkey home page Code Monkey logo

darkr's Introduction

Hey! βœ‹πŸ˜ƒ

Currently a product manager / metadata expert at Insee.

Nowadays i mainly produce issues and comments but i sometimes code! πŸ™‚

(rarity color palette)

Static Badge Static Badge Static Badge

Static Badge Static Badge

darkr's People

Contributors

bowerth avatar romaintailhurat avatar

Watchers

 avatar  avatar

Forkers

bowerth

darkr's Issues

Java dependency mismatch when releasing on R-hub

Before pushing to CRAN, i use R-hub as is advised.

When doing so, the tests are in error because the provided JVM is not adapted to the version used to compile classes:

* checking tests ...
  Running β€˜testthat.R’
 ERROR
Running the tests in β€˜tests/testthat.R’ failed.
Last 13 lines of output:
  
  ── 6. Error: Instantiate InMemoryDataset (@test-java_utils.R#2)  ───────────────
  java.lang.UnsupportedClassVersionfr/insee/vtl/model/Dataset has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 0 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 6 ]
  1. Error: Creating a list of components from a dataframe (@test-dataset.R#3) 
  2. Error: Can create a list of data from a df (@test-dataset.R#10) 
  3. Error: Can create a dataset from a dataframe (@test-dataset.R#17) 
  4. Error: Evaluation is done right (@test-evaluation.R#5) 
  5. Error: Datasets, drop operation (@test-evaluation.R#11) 
  6. Error: Instantiate InMemoryDataset (@test-java_utils.R#2) 
  
  Error: testthat unit tests failed
  Execution halted

This easiest solution would be to recompile the classes with Java 8 (52), see the list of java versions.

Another more complex option would be to see if another runtime can be used with R-hub and CRAN.

Memoise the engine creation function

We could memoize the call to get_engine using:

memoise <- function(fun) {
  memory <- list()
  function(x) {
    valueName <- as.character(x)
    if (!is.null(memory[[valueName]])) return(memory[[valueName]])
    res <- fun(x)
    memory[[valueName]] <<- res
    res
  }
}

fn <- function(n) {
  sample(1:n, size = n)
}

From dataset to dataframe

We already transform a dataframe into a dataset (specifically a Trevas InMemoryDataset).

We now need to produce the inverse operation.

VTL expression constructor

Currently, darkr supports VTL expression in the form of string, eg. derived := initial[ drop age ].

It may be cool to have builder functions, for example:

ds2 <- create(derived) %>%
          from(initial) %>%
          drop(age)

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.