Comments (13)
I often have to alternate between "clear" and "clear classes" 2-3 times until I don't get these messages any more. It has always been like that for me. Does that work in your case?
from datajoint-matlab.
I've always had difficulties clearing classes in one go. I always chucked it to Matlab's immaturity in the OOP arena. I didn't think that this could be helped. Generally classes do not clear at all if there is an open plot that was plotted using datajoint classes. I often do close all, clear classes, clear classes
.
Do you think this got worse recently?
from datajoint-matlab.
I've tried cycles of clear
and clear classes
, but after 20 iterations I still get the same warnings. Older versions of DJ, going back to March 2013, have the same problem. It seems that I have never noticed this problem before.
from datajoint-matlab.
You also need to close all figures because any objects associated with a figure are not destroyed by clear classes
. I have not seen a case when classes could not be destroyed after close all, clear classes, clear classes, clear classes
.
from datajoint-matlab.
There are no plots open. I start MATLAB, instantiate one object and then try clear classes
. The only way to clear the classes is a restart.
from datajoint-matlab.
oh, in this case, I get no problems. Classes clear without any warnings. I have never seen this then. I only see this problem with plots, etc.
What's different between our setups?
from datajoint-matlab.
I think much of the problem comes from the use of Constant properties comprising complex objects with references to other objects. These have funny scopes in MATLAB. Perhaps MATLAB does not know how to clear these very well. Also, MATLAB makes it difficult to know what these undeleted objects are.
I am thinking that in DataJoint 2.7 we should eliminate the reliance on Constant properties. This means that the table
property will not be required (but allowed for backward compatibility) and all data definition language (DDL) methods would be wrapped into dj.Relvar
. Also, popRel
would no longer be required to be Constant
.
Do we have any evidence that the culprits are the constant properties table
and popRel
?
from datajoint-matlab.
It sounds plausible. Matlab simply doesn't know in what order to clear the classes and Andreas may have a tree that is particularly ill-suited for Matlab's heuristics.
As a solution, why not just make the table a normal (non-constant) property? Looking at the constructor of dj.Table, creating a table object on the fly doesn't strike me as a particularly costly operation. I would at least try that route first to see it the table property is really the culprit. The same should apply to popRel. Creating relvars is usually fast, as long as they are not displayed. And once the properties are not constants anymore, the problem should be gone.
from datajoint-matlab.
MATLAB's suckiness is unfortunate. We may need to give up some of the elegance afforded by Constant properties.
One reason for Constant properties was to be able to address them directly without instantiating an object.
If we make popRel
and table
non-static properties, then patch.CleanEphys.popRel
will need to become a = patch.CleanEphys; a.popRel
.
With respect to table
, I think I will just make dj.Relvar
inherit from dj.Table
. This way you will not need to add a table
property to each class. You can still do it, but it's unnecessary. This means that the bare-bones Relvar class does not need to have anything in it:
%{
<<< table definition >>>
%}
classdef package.ClassName
end
I have already implemented this and it works well. I will make this release 2.7.0.
You can still add a constant table
property to make it work the same way as before. But now you can apply the data-definition methods directly to the dj.Relvar
object rather than to its table
property.
drop(package.ClassName)
alterAttribute(package.ClassName, '...')
Again, none of this breaks backward compatibility. This release will fix issues 22, 23, 24.
from datajoint-matlab.
Pushed the fix on master: f4f9b2c.
Closing.
from datajoint-matlab.
With table
gone, there seem to be fewer issues regarding the clearing of classes. But popRel
is still a constant property for all auto-populated tables and is causing the same problems with the garbage collector.
from datajoint-matlab.
popRel
is no longer required to be Constant
. It is allowed to be constant for backward compatibility. When you create a new class using dj.new
, popRel
will be declared as a regular property.
from datajoint-matlab.
Ah, thank you for the clarification! That should solve our remaining issues.
from datajoint-matlab.
Related Issues (20)
- bug with fetchn in DJ 3.4.1 MATLAB
- External table error - working with schema having existing external table (declared with datajoint-python) HOT 2
- Markdown not properly rendered in FEX Toolbox description
- fetchn(tableA * tableB, 'field') does not work in 3.4.2
- del deletes some incorrect entries from downstream tables with renamed foreign keys HOT 1
- table classes on path was not recognized when deleting or populating
- error with fetchn DataJoint version 3.4.2 HOT 1
- `{}` is not supported in attribute comments HOT 1
- bool and boolean is not supported in 3.4.1 HOT 1
- Parallelize file transfer for external blobs HOT 1
- bug with del() HOT 6
- Occasional fwrite errors using file-based stores
- fetching 'KEY' error HOT 2
- discovering existing tables across python/matlab HOT 5
- Empty matrices are converted to NULL HOT 2
- syncDef missing [nullable] & comment properties HOT 2
- Officially use the `+` operator for unions
- SSL Connection error HOT 2
- Schema name must start with lower case HOT 2
- Allow strings as well as char HOT 2
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 datajoint-matlab.