profile
viewpoint
Iñaki Ucar Enchufa2 UC3M-Santander Big Data Institute Madrid http://www.enchufa2.es PhD in Telematic Engineering | R | Fedora | Data Science | Clarinetist

Enchufa2/bspm 42

R Bridge to System Package Manager

Enchufa2/cran2copr 15

Creating Fedora packages in a Copr repo from CRAN sources

Enchufa2/r-flexiblas 8

FlexiBLAS API Interface for R

Enchufa2/bmetr 5

Beethoven's Metronome Analysis

Enchufa2/nantools 5

NaNTools: Yet another set of Network aNalysis Tools

Enchufa2/irpf 3

Calculadora del IRPF

Enchufa2/ls-springs 2

Least squares as springs

Enchufa2/crap 1

Random crap tools

PullRequestReviewEvent

delete branch r-quantities/units

delete branch : fix/297

delete time in 2 days

issue closedr-quantities/units

Development version of units seems to fail with spaces in labels

I was working with the development version the package. I seem to get error when i introduce spaces in labels, for both make_unit_label and plot and with ggplot. Either something is messed up in my system or it would be quite an annoying bug

require(units)
#> Loading required package: units
#> udunits database from /usr/share/xml/udunits/udunits2.xml
make_unit_label('s df',set_units(3,'Hz'))
#> Error in parse(text = str): <text>:1:3: unexpected symbol
#> 1: s df
#>       ^
d<-data.frame(a=set_units(1:5,'m'),b=set_units(5:1,'Hz')) 
plot(d$a, d$b, xlab='sd df')
#> Error in parse(text = str): <text>:1:4: unexpected symbol
#> 1: sd df
#>        ^
require(ggplot2)
#> Loading required package: ggplot2
ggplot(d, aes(a,b))+geom_point()+xlab('sa df')
#> Error in parse(text = str): <text>:1:4: unexpected symbol
#> 1: sa df
#>        ^
sessionInfo()
#> R version 4.1.2 (2021-11-01)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.3 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=nl_NL.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=nl_NL.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=nl_NL.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=nl_NL.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] ggplot2_3.3.5 units_0.8-0  
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.8        pillar_1.6.4      compiler_4.1.2    highr_0.9        
#>  [5] R.methodsS3_1.8.1 R.utils_2.11.0    tools_4.1.2       digest_0.6.29    
#>  [9] evaluate_0.14     lifecycle_1.0.1   tibble_3.1.6      gtable_0.3.0     
#> [13] R.cache_0.15.0    pkgconfig_2.0.3   rlang_0.4.12      reprex_2.0.1     
#> [17] DBI_1.1.2         yaml_2.2.1        xfun_0.28         fastmap_1.1.0    
#> [21] dplyr_1.0.7       withr_2.4.3       styler_1.6.2      stringr_1.4.0    
#> [25] knitr_1.36        generics_0.1.1    fs_1.5.1          vctrs_0.3.8      
#> [29] tidyselect_1.1.1  grid_4.1.2        glue_1.6.0        R6_2.5.1         
#> [33] fansi_1.0.2       rmarkdown_2.11    farver_2.1.0      purrr_0.3.4      
#> [37] magrittr_2.0.1    backports_1.4.0   scales_1.1.1      ellipsis_0.3.2   
#> [41] htmltools_0.5.2   assertthat_0.2.1  colorspace_2.0-2  labeling_0.4.2   
#> [45] utf8_1.2.2        stringi_1.7.6     munsell_0.5.0     crayon_1.4.2     
#> [49] R.oo_1.24.0

<sup>Created on 2022-01-20 by the reprex package (v2.0.1)</sup>

closed time in 2 days

bart1

push eventr-quantities/units

Iñaki Ucar

commit sha f388fbaec59d10e4a7b82d3ecdd6da8a3ab09f1c

Fix plot labels with spaces (#298) * fix plot labels * add more tests * update NEWS

view details

push time in 2 days

PR merged r-quantities/units

Fix plot labels with spaces

Closes #297. @edzer I simplified a bit the logic to add units to labels, with some changes:

  • ~I don't think we should export make_unit_label anymore. This was probably exported to enable ggforce to set the labels easily, right? But it was not used correctly anyway. Now that we have included ggforce's functionality, I have renamed the function as make_unit_label_internal and deprecated direct calls to make_unit_label (which calls the former one) if this is ok with you. Or are you aware of any other package really requiring make_unit_label?~ See below.
  • The specific fix for #297 is included in make_unit_label, which replaces spaces with ~ if the label is a string.
  • Previously, units were not added if the user provided a custom label (via xlab, ylab). Instead, I think that we should always add units, as implemented in this PR. And if the user do not want units, they should just drop them.
+665 -43

8 comments

8 changed files

Enchufa2

pr closed time in 2 days

pull request commentr-quantities/units

Fix plot labels with spaces

Done, so if no further comments from @edzer, we are good to go. :)

Enchufa2

comment created time in 2 days

push eventr-quantities/units

Iñaki Úcar

commit sha 66590e75792727c20a8dc076da71931e0a1d7a3b

undeprecate make_unit_label

view details

push time in 2 days

pull request commentr-quantities/units

Fix plot labels with spaces

There are projects using make_unit_label after all... Let's undeprecate it then. :(

Enchufa2

comment created time in 2 days

pull request commentr-quantities/units

Fix plot labels with spaces

Thanks for testing. To be able to properly show powers, unit labels must be expressions, and thus we lose the ability to insert a newline or a tab character.

Enchufa2

comment created time in 2 days

issue commentmpimd-csc/flexiblas

Int instead of int in standalone API

Perfect. I include flexiblas_api_standalone.c in the R package here. Should I patch it there to match the header?

Enchufa2

comment created time in 2 days

issue commentr-quantities/units

Release units 0.8-0

@hongyuanjia Once units 0.8.0 is uploaded with these functions removed, you package will give a WARNING due to references to missing functions. It is true that your code would never call them (because it checks units version first), but anyway the WARNING will pop up, because CRAN checks for this are not this clever. Therefore, as I said in the comment I left in your repo, you either remove those calls complete and depend on units >= 0.7.0, or implement the trick I use in the constants package.

Enchufa2

comment created time in 2 days

issue commentr-quantities/units

Development version of units seems to fail with spaces in labels

@bart1 Could you please install the branch in #298 and test it a bit?

bart1

comment created time in 2 days

pull request commentr-quantities/units

Fix plot labels with spaces

Examples:

library(units)
#> udunits database from /usr/share/udunits/udunits2.xml
library(ggplot2)

mtcars$consumption <- set_units(mtcars$mpg, mi / gallon)
mtcars$power <- set_units(mtcars$hp, hp)

plot(consumption~power, mtcars, xlab="asdf asdf")

p <- ggplot(mtcars) + geom_point(aes(power^2, consumption))
p + xlab("some^2 custom stuff")

p + xlab(NULL)

<sup>Created on 2022-01-20 by the reprex package (v2.0.1)</sup>

Enchufa2

comment created time in 2 days

PR opened r-quantities/units

Fix plot labels with spaces

Closes #297. @edzer I simplified a bit the logic to add units to labels, with some changes:

  • I don't think we should export make_unit_label anymore. This was probably exported to enable ggforce to set the labels easily, right? But it was not used correctly anyway. Now that we have included ggforce's functionality, I have renamed the function as make_unit_label_internal and deprecated direct calls to make_unit_label (which calls the former one) if this is ok with you. Or are you aware of any other package really requiring make_unit_label?
  • The specific fix for #297 is included in make_unit_label_internal, which replaces spaces with ~ if the label is a string.
  • Previously, units were not added if the user provided a custom label (via xlab, ylab). Instead, I think that we should always add units, as implemented in this PR. And if the user do not want units, they should just drop them.
+675 -43

0 comment

8 changed files

pr created time in 2 days

push eventr-quantities/units

Iñaki Úcar

commit sha cfcfd06b92322b921d287bea15742b75fb46e19f

fix indentation in a couple of lines

view details

push time in 2 days

create barnchr-quantities/units

branch : fix/297

created branch time in 2 days

issue commentr-quantities/units

Development version of units seems to fail with spaces in labels

Thanks for spotting this.

  • make_unit_label has not been touched since... years now, so it's the same behaviour as in most (all?) previous versions,
  • which means that this issue was present already in ggforce, because I just copied their implementation.
  • In base plot, the issue is new, certainly, because I copied also the usage that ggforce made of make_unit_label there.

In other words, it's probably make_unit_label what needs to be fixed, because apparently the usage is not clear. :)

bart1

comment created time in 2 days

issue commentRcppCore/Rcpp

Error updating to 1.0.8

FWIW I can confirm that this is the only change required for me to be able to compile with -std=c++98.

On the one hand, I think we should start cleaning up things and getting rid of all pre-C++11 code, enforcing at least this standard. On the other hand, it's also very cheap to insert a space there for the time being to match every other appearance of something<std::vector<std::string> > in that very same file. :)

crewalsh

comment created time in 2 days

issue openedmpimd-csc/flexiblas

Wrong -verbose flag in CXXFLAGS

Here: https://github.com/mpimd-csc/flexiblas/blob/c335f62590fd74c44255455507e8414bab23eb9a/tools/flexiblas-octave/src/Makefile#L14

Should be --verbose. Somehow this was filtered out, but apparently now it's not. Very minor thing, no need to push another release for this. I'll just sed it out in the spec.

created time in 3 days

issue openedmpimd-csc/flexiblas

Int instead of int in standalone API

I've noticed that a number of functions have changed from int to Int in flexiblas_api.h. They are equal per the define on top of that header, but shouldn't this change in flexiblas_api_standalone.c too?

created time in 3 days

issue closedr-quantities/units

Coversion of area times length to volume

To calculate the number of L of rain falling on an area we calculate area*depth. This doesn't appear to work with units because m2 != m^2. Is there a correct way of doing this with out dropping units and then reapplying them?

Example:

area <- set_units(10, ha)
rain <- set_units(1000, mm)
(area*rain)
# 10000 [ha*mm]
area*rain %>% set_units(L)
# Error: cannot convert mm into L

closed time in 3 days

vorpalvorpal

issue commentr-quantities/units

Coversion of area times length to volume

@vorpalvorpal In other words, without parentheses, you think you are doing this

(area * rain) |> set_units("liter")
#> 1e+08 [L]

but instead you are doing this

area * (rain |> set_units("liter"))
#> Error: cannot convert mm into L

See https://stat.ethz.ch/R-manual/R-devel/library/base/html/Syntax.html

vorpalvorpal

comment created time in 3 days

issue commentmpimd-csc/flexiblas

3.1.0 build failures

The second one is specific to CMake + GCC/GFortran 12 + CMake's FortranC Interface. I created the following MWE, which produces the crash without requiring anything from FlexiBLAS.

About this, it seems that, with gcc 12, when FFLAGS contains -flto=auto, the generated VerifyFortran.h contains nothing, thus the test error. There's a warning before that:

CMake Warning (dev) at /usr/share/cmake/Modules/FortranCInterface.cmake:309 (message):
  No FortranCInterface mangling known for VerifyFortran
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FortranCInterface/Verify/CMakeLists.txt:16 (FortranCInterface_HEADER)
This warning is for project developers.  Use -Wno-dev to suppress it.

Any idea about how to debug this, how to tell cmake to output every command it is running?

Enchufa2

comment created time in 4 days

push eventEnchufa2/cran2copr

Iñaki Úcar

commit sha bb0df9868c1ee8bfbac6b1cf410145bd3840a6c9

f33 is EOL

view details

push time in 4 days

issue closedmpimd-csc/flexiblas

3.1.0 build failures

I sent scratch builds to Fedora 35 and rawhide:

  • Builds are fine in F35. There's an error at the end because we had in the previous version:
$ ll /usr/lib64/libflexiblas*
lrwxrwxrwx. 1 root root      23 jul 22 02:19 /usr/lib64/libflexiblas64_api.so -> libflexiblas64_api.so.3
lrwxrwxrwx. 1 root root      25 jul 22 02:19 /usr/lib64/libflexiblas64_api.so.3 -> libflexiblas64_api.so.3.0
-rwxr-xr-x. 1 root root   15960 jul 22 02:20 /usr/lib64/libflexiblas64_api.so.3.0
lrwxrwxrwx. 1 root root      24 jul 22 02:19 /usr/lib64/libflexiblas64_mgmt.so -> libflexiblas64_mgmt.so.3
lrwxrwxrwx. 1 root root      26 jul 22 02:19 /usr/lib64/libflexiblas64_mgmt.so.3 -> libflexiblas64_mgmt.so.3.0
-rwxr-xr-x. 1 root root   49760 jul 22 02:20 /usr/lib64/libflexiblas64_mgmt.so.3.0
lrwxrwxrwx. 1 root root      19 jul 22 02:19 /usr/lib64/libflexiblas64.so -> libflexiblas64.so.3
lrwxrwxrwx. 1 root root      21 jul 22 02:19 /usr/lib64/libflexiblas64.so.3 -> libflexiblas64.so.3.0
-rwxr-xr-x. 1 root root 3880056 jul 22 02:20 /usr/lib64/libflexiblas64.so.3.0
lrwxrwxrwx. 1 root root      21 jul 22 02:19 /usr/lib64/libflexiblas_api.so -> libflexiblas_api.so.3
lrwxrwxrwx. 1 root root      23 jul 22 02:19 /usr/lib64/libflexiblas_api.so.3 -> libflexiblas_api.so.3.0
-rwxr-xr-x. 1 root root   15960 jul 22 02:20 /usr/lib64/libflexiblas_api.so.3.0
lrwxrwxrwx. 1 root root      22 jul 22 02:19 /usr/lib64/libflexiblas_mgmt.so -> libflexiblas_mgmt.so.3
lrwxrwxrwx. 1 root root      24 jul 22 02:19 /usr/lib64/libflexiblas_mgmt.so.3 -> libflexiblas_mgmt.so.3.0
-rwxr-xr-x. 1 root root   49752 jul 22 02:20 /usr/lib64/libflexiblas_mgmt.so.3.0
lrwxrwxrwx. 1 root root      17 jul 22 02:19 /usr/lib64/libflexiblas.so -> libflexiblas.so.3
lrwxrwxrwx. 1 root root      19 jul 22 02:19 /usr/lib64/libflexiblas.so.3 -> libflexiblas.so.3.0
-rwxr-xr-x. 1 root root 3872616 jul 22 02:20 /usr/lib64/libflexiblas.so.3.0

and now:

Processing files: flexiblas-netlib-3.1.0-1.fc35.x86_64
error: File not found: /builddir/build/BUILDROOT/flexiblas-3.1.0-1.fc35.x86_64/usr/lib64/libflexiblas.so.3.1
error: File not found: /builddir/build/BUILDROOT/flexiblas-3.1.0-1.fc35.x86_64/usr/lib64/libflexiblas_api.so.3.1
error: File not found: /builddir/build/BUILDROOT/flexiblas-3.1.0-1.fc35.x86_64/usr/lib64/libflexiblas_mgmt.so.3.1

Is this intentional? Should I just remove the library files with the minor version?

/usr/bin/ld: /tmp/cccPyAll.ltrans0.ltrans.o: in function `main':
    /usr/share/cmake/Modules/FortranCInterface/Verify/main.c:14: undefined reference to `VerifyFortran'
    collect2: error: ld returned 1 exit status

See the complete log e.g. here. Relevant differences? In F35 we have gcc 11.2.1; in rawhide, there's gcc 12.0.0.

closed time in 5 days

Enchufa2

issue commentmpimd-csc/flexiblas

3.1.0 build failures

Looking good now, thanks! I'll update F34 and F35 to v3.1.2 and wait until the gcc thing is resolved for rawhide. Thanks for the MWE above too!

Enchufa2

comment created time in 5 days

issue commentmpimd-csc/flexiblas

3.1.0 build failures

Oh, and for 64-bit systems, in the 64-bit build,

error: Installed (but unpackaged) file(s) found:
   /usr/bin/-config
   /usr/bin/flexiblas-config

-config is generated instead of flexiblas64-config. Or maybe this is an error in my SPEC? Complete log: https://kojipkgs.fedoraproject.org//work/tasks/2955/81362955/build.log

Enchufa2

comment created time in 5 days

issue commentmpimd-csc/flexiblas

3.1.0 build failures

What is flexiblas-config? Is it the flexiblas utility but renamed?

Enchufa2

comment created time in 5 days

issue commentmpimd-csc/flexiblas

3.1.0 build failures

FWIW, Koschei reports that version 3.0.4 fails with the same error with gcc 12: https://koschei.fedoraproject.org/package/flexiblas?collection=f36

Enchufa2

comment created time in 5 days

issue commentmpimd-csc/flexiblas

3.1.0 build failures

For the first one it is correct that the version of the libraries are increased since there a some new symbols in. That allows old programs to use the new libraries without relinking but code that uses the new ones should not use the 3.0 library version.

I mean, the issue is that the RPM expects files with 3.1 appended, but these are not generated in the new version.

For the second one I took a look into the build logs and it seems, as in the thread you linked, that this is a problem of gcc 12 and cmake. Is there a way to use FC rawide with gcc 12 in docker for checking it?

There's no rawhide compose with gcc 12 yet, but you can manually download the latest build from here and install them in a rawhide container.

Enchufa2

comment created time in 5 days

more