Comments (7)
This was an old issue. inherits
doesn't work on simList
. It was LONG ago changed to class( ). I am undoing the portion of the commit that made this 0129288 . It must stay class
or we need to diagnose why inherits
fails and fix that. For now, class
is fine.
EDIT: I am incorrect on this diagnosis. There was something that happened a while ago with this, but I am mis-remembering the details. This error may simply be a case of correcting the use of inherits
, which takes 2 arguments. Working on it...
from spades.core.
It may have been a speed issue, but I think both are "fast enough"
microbenchmark::microbenchmark(inherits(sim, "simList"), class(sim)== "simList", is(sim, "simList"), times = 1e4)
Unit: nanoseconds
expr min lq mean median uq max neval cld
inherits(sim, "simList") 880 1174 1778.6009 1467 1760 23462 10000 b
class(sim) == "simList" 293 587 967.7314 880 880 43698 10000 a
is(sim, "simList") 4986 6159 7612.0034 6452 6746 50443 10000 c
from spades.core.
I've fixed it in my branch.
Note we use inherits(sim, "simList")
elsewhere with no issue.
from spades.core.
if it's a speed issue, should we change all instances of inherits(sim, "simList")
to class(sim) == "simList"
?
from spades.core.
I think the difference is only relevant if the function is being run EVERY event. Even then, probably fine. I believe inherits(...) is "more correct", but I don't really know the strong arguments.
from spades.core.
See discussion here: https://stackoverflow.com/questions/27923345/whats-the-difference-between-is-and-inherits
(is vs. inherits). They note the integer difference ... I will look for discussions about class vs inherits
from spades.core.
Yes, I believe inherits
is more correct.
But since it's in the doEvent
, I'll make the change based on speed.
from spades.core.
Related Issues (20)
- simulation caching issues in tests HOT 3
- sporadic download failures triggering test failure HOT 4
- don't install packages during tests HOT 3
- Enable passing new `sourceURL`s to metadata
- New feature idea/request: cross-module, project-contained, functions HOT 8
- error when saving several objects with ``saveFiles()`` and ``.saveObjects`` HOT 3
- Use `ggplotify` in Plots to plot non-ggplot graphics HOT 1
- newModule() should create NEWS.md file
- fix additional issues with noSuggests CRAN checks HOT 2
- use consistent per-module paths for output figures HOT 2
- `newModule` is failing when SpaDES.core isn't loaded HOT 2
- `spades` not caching properly. HOT 1
- `paramCheckOtherMods` can't deal with vector parameters with length > 1 HOT 3
- Misleading/wrong module code checks HOT 2
- saveSimList() hangs using qs; writing massive files HOT 1
- saveSimList() forces use of qs HOT 1
- saveSimList() documentation out-of-date
- GDAL colour table warnings in test-save.R
- saveSimList() archives aren't using correct relative file paths HOT 2
- save/load simList without archiviing/extracting all files HOT 1
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 spades.core.