Giter Site home page Giter Site logo

attempt's Introduction

Hi there ๐Ÿ‘‹

Welcome to my GitHub account!

I'm Colin, and (probably like a lot of people here), I love writing code.

My languages of choice are R, JavaScript and Docker. I love building infrastructures and backends.

Here are some of the things I've been working on lately:

I also have a bunch of Docker image I maintain on my Docker hub.

I love to speak around the world, and most of my talks are available on my speakerdeck, and if you're looking for the video I try to keep the list on my website up to date.

You can learn more about me on my website colinfay.me where I blog on a random basis and on Twitter at @_ColinFay where I tweet quite frequently.

I probably forgot a lot of things here, so feel free to explore my profiles and website, and to contact me if you need my help!

attempt's People

Contributors

antoine-sachet avatar colinfay avatar krlmlr avatar nfultz avatar sowla avatar statnmap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

attempt's Issues

Bug when using try_catch with a variable

library(attempt)

a <- 1
try_catch(log(a), 
          .e = ~ .x)
<simpleError in doTryCatch(return(expr), name, parentenv, handler): objet 'a' introuvable>

log_it <- function(a){
  try_catch(log(a), 
            .e = ~ .x)
}

log_it(1)
<simpleError in doTryCatch(return(expr), name, parentenv, handler): objet 'a' introuvable>

variant of map_try_catch_df that returns a list of dfs

I propose a variant of map_try_catch_df that returns a list of 1 row tibbles instead of a single df.

For argument's sake it could be called map_try_catch_ltbl This would facilitate usage inside tidy modelling pipelines e.g.

  train_data %>%
  group_by(group_var) %>%
  nest() %>%
  mutate(result = map_try_catch_ltbl(data, fit_model)) %>%
  unnest(result)

## resulting tibble now contains call, error, warning, value columns.

Helpful arguments I can think of:

  • Allow user to name the value column so that when it is unnested it doesn't require a rename.
  • Allow user to turn on/off capturing of call

Possible extension: Also allow capturing of messages?

discretly or discreetly?

Awesome package! I've always found the interface to try and tryCatch confusing.

But I hate to be that person: I think you made a typo in calling your function discretly. I imagine you were going for discreetly (with two es), meaning:

In a careful and prudent manner, especially in order to keep something confidential or to avoid embarrassment. (from the OED)

You probably don't want to break code by changing the name of the function, but you could alias one or the other (and maybe output a message when discretly is called).

stop_if_none : behavior different than expected

stop_if_none doesn't behave like I expected. Shouldn't it be equivalent to stop_if_not(any()) ?
I am a french speaker but that is how I understand the term "none" = "not any"

attempt::stop_if_none(c(T, T), msg = "Error") # No error, fine for me
attempt::stop_if_none(c(F, F), msg = "Error") # Error, fine for me
attempt::stop_if_none(c(T, F), msg = "Error") # Error, while I was expecting No error

attempt::stop_if_not(any(c(T, T)), msg = "Error") # No error
attempt::stop_if_not(any(c(F, F)), msg = "Error") # Error
attempt::stop_if_not(any(c(T, F)), msg = "Error") # No error

[Enhancement] Several precidate

We should be able to run several test on the objects in one call, so that we don't have to repeat the tests.

Something that would look like:

stop_if( 10, list(is.null, is.numeric), "plop" )

`lang()` is deprecated

It has been deprecated since rlang 0.2.0 (released 4 years ago). It has been renamed to call2(). Please also use !!! instead of splice().

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.