Comments (9)
Looping @chisingh in on this, let's coordinate on unit tests for R and python.
One idea that wasn't obvious when this was created, but makes sense now: unit tests can check the specs generated on the backend language side, perhaps not a checksum or hash but checking for certain key fields in the generated json.
from datamations.
It looks like there are some old specs that no longer work, e.g. here:
https://github.com/microsoft/datamations/blob/main/inst/htmlwidgets/test/index.html
Let's get rid of them to avoid confusion going forward.
from datamations.
I've cleaned out the sandbox folder so it only has working specs.
from datamations.
Re: testing, there are a bunch of tests here that check the format / fields of the json on the R end. Definitely not 100% test coverage because of all the shiny, legacy code, etc, but a decent start on the core functionality:
(the middle columns show lines, covered, missed, etc - but the last column is coverage for each file)
I'm still trying to think of the best way to compare the python vs R specs within the testthat framework (which is commonly used for R packages). If the python code can write specs to a json file, we can read those in, generate the R specs, and check that they're the same as a start!
from datamations.
sounds like a good idea on writing python json specs out to files and testing them w/ the R testthat framework.
@chisingh, let's work on this once python is up and running.
from datamations.
I have added unit tests using pytest framework that can also be enabled to run after every commit once issue #104 is closed. Some of these tests use the raw json files provided by @sharlagelfand to verify that both the outputs match.
from datamations.
@chisingh will output json specs from python and @sharlagelfand will read that in and test w/ testthat in R
from datamations.
Just working on testing those specs @chisingh and it looks like there are some discrepancies in ordering of things - in the R specs, meta
comes before data
, but in the python specs data
comes first.
Similarly in the data.values
, the order of fields do not match, e.g. in R:
"gemini_id": 20,
"Work": "Academia",
"datamations_x": 1,
"datamations_y": 85.0122219615483,
"datamations_y_tooltip": 85.0122219615483,
"datamations_y_raw": 85.3303201349918,
"Lower": 84.7637160761228,
"Upper": 85.2607278469738
versus in python:
"gemini_id": 20,
"Work": "Academia",
"datamations_x": 1,
"datamations_y": 85.01222196154829,
"datamations_y_raw": 85.33032013499178,
"datamations_y_tooltip": 85.01222196154829,
"Lower": 84.76371607612279,
"Upper": 85.2607278469738
The order of datamations_y_raw
and datamations_y_tooltip
are flipped here.
Otherwise the specs look equivalent! Just something it might be nice to keep in mind and change if not too big of a hassle, otherwise I will have to match the ordering before each test.
from datamations.
That's great! I will reorder those fields.
from datamations.
Related Issues (20)
- Update Javascript documentation HOT 4
- Get python to parity with R updates HOT 1
- JS code as npm package and write unit tests HOT 1
- Clean up final error bars on zoom HOT 1
- Penguins example looks funny HOT 15
- Update package version to resolve dependabot security warning
- Penguins example breaks with 2 or 3 variables in shiny app HOT 2
- Find a spot for the updated shiny app HOT 1
- R-CMD-check workflow failing HOT 1
- This repo is missing important files
- ESLint workflow failing
- Pylint workflow failing HOT 1
- Implementation of Min and Max aggregation functions in JavaScript HOT 1
- Implementation of Sum and Product aggregation functions in JavaScript HOT 1
- Implementation of Count and Count Numbers aggregation functions in JavaScript HOT 1
- Implement Count and Quantile in Python
- Implement Min and Max in Python HOT 1
- Implement Sum and Product in Python HOT 1
- Respect factor orderings HOT 1
- Supported R version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datamations.