classdef problems

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

classdef problems

Richard Crozier

I'm using 498b2dd1bd56 (classdef).

I get many many warnings such as the following when I have a certain  
set of directories on my path, and they happen with every command:

warning: load_path:  
./renewnet-foundry/structural/tb-roark_stress_and_strain/beam_theory:  
No such file or directory
warning: load_path:  
./renewnet-foundry/structural/tb-roark_stress_and_strain/beam_theory/Slope: No  
such file or directory
warning: load_path:  
./renewnet-foundry/structural/tb-roark_stress_and_strain/beam_theory/Properties_Of_Sections: No such file or  
directory
warning: load_path:  
./renewnet-foundry/structural/tb-roark_stress_and_strain/beam_theory/Deflections: No such file or  
directory
warning: load_path:  
./renewnet-foundry/structural/tb-roark_stress_and_strain/beam_theory/Moments:  
No such file or directory
warning: load_path:  
./renewnet-foundry/structural/tb-roark_stress_and_strain/beam_theory/Generic:  
No such file or directory
warning: load_path: ./renewnet-foundry/financial: No such file or directory
warning: load_path: ./renewnet-foundry/financial/matlab-octave: No  
such file or directory


I haven't tested these with default, more worryingly, I'm getting  
bizzarre behaviour with some other functions such as ls, for example  
see the folllowing seesion:

---------------------------------------------------------------

GNU Octave, version 3.7.5
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type 'news'.

octave-cli:1> addpath (genpath('.'))
warning: function ./<snip>/tb-multicore/gethostname.m shadows a  
built-in function
warning: function ./<snip>/+oandm/system.m shadows a built-in function
warning: function ./<snip>c/+oandm/system.m shadows a built-in function
octave-cli:2> ls
class: system
superclass: handle
method block
constructor: system
method: evaluate
method: addcomponent
method: service
method: plotmaintenancescatter
method: plotrevenuescatter
method: plotnetrevenuescatter
property block
property attribute: SetAccess = protected
property attribute: GetAccess = public
property: Components
property default:
property: NReplicates
property: MaintenanceCosts
property: ComponentMaintenanceCosts
property: Revenue
property: NetRevenue
property: IntervalRevenue
property: ServiceInterval
property: InspectionInterval
property: ServiceFixedCost
property: ServiceIntervalRate
property: ServiceDurationParams
constructor
error: zeros: invalid data type specified
error: called from:
error:   /<snip>/+oandm/system.m at line 57, column 35
deleting system object (handle)
error:   /usr/local/share/octave/3.7.5/m/miscellaneous/ls.m at line  
69, column 20

---------------------------------------------------------------

As you can see I haven't created any system objects in the session, so  
I don't understand the messages about them at the start. They are in a  
package (+directoryname) changing this to remove the '+' results in  
the same issue though. The paths I add contain normal functions, .mat  
files, and old-style classes.

when I quit I get:

---------------------------------------------------------------
deleting meta.method object (handle)
deleting meta.method object (handle)
deleting meta.method object (handle)
deleting meta.method object (handle)
deleting meta.method object (handle)
deleting meta.method object (handle)
deleting meta.method object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.property object (handle)
deleting meta.class object (handle)
--------------------------------------------------------------

This is all using octave-cli

If I remove the directory containing the classdef classes all the  
described problems go away.

Richard


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Richard Crozier
Quoting Richard Crozier <[hidden email]> on Thu, 12 Sep 2013  
11:26:12 +0100:

>
> I'm using 498b2dd1bd56 (classdef).
>


To further test this, I added only the +oandm directory containing the  
clasdef classes, everything works fine, then I change directory, and  
start getting the problems. I started the session from the directory  
containing the +oandm folder.

richard@rc ~/src $ octave-cli
warning: function ./+oandm/system.m shadows a built-in function
GNU Octave, version 3.7.5
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type 'news'.

octave-cli:1> addpath ('+oandm')
warning: function +oandm/system.m shadows a built-in function
octave-cli:2> pwd
ans = /home/richard/src
octave-cli:3> cd <snip>/
warning: load_path: +oandm: No such file or directory
octave-cli:4> temp = oandm.component(1)
warning: load_path: +oandm: No such file or directory
warning: load_path: +oandm: No such file or directory
error: 'oandm' undefined near line 1 column 8
octave-cli:4> ^C
octave-cli:4> quit
warning: load_path: +oandm: No such file or directory

warning: load_path: +oandm: No such file or directory
richard@rc ~/src $ octave-cli
warning: function ./+oandm/system.m shadows a built-in function
GNU Octave, version 3.7.5
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type 'news'.

octave-cli:1> addpath ('+oandm')
warning: function +oandm/system.m shadows a built-in function
octave-cli:2> temp = oandm.component(1)
meta.package query: component
class: oandm.component
superclass: handle
method block
method attribute: Access = public
constructor: component
method: update
method: service
method: inspect
method block
method attribute: Access = protected
method: updatefailurestatus
method: damagedetectionprob
method: updateservicedamage
method: updateimpairment
method: updatedamage
property block
property attribute: SetAccess = public
property attribute: GetAccess = public
property: DamageType
property default: 1
property: DamageParams
property default: 0.1
property: FailureRate
property default: 0
property: DamageDetectionLambdaService
property default: 0.5
property: DamageDetectionLambdaInspection
property default: 0.6
property: DamageDetectionLambdaMonitoring
property default: 1.0
property: DamageDetectionMaxProbService
property default: 0.9
property: DamageDetectionMaxProbInspection
property default: 0.9
property: DamageDetectionMaxProbMonitoring
property default: 0.9
property: DamageRepairBarrier
property default: 0.4
property: DamageReplaceBarrier
property default: 0.9
property: DamageDetectionRepairDistribution
property default: [0.6, 0.2]
property: DamageRepairReduction
property default: 0.3
property: ImpairmentType
property default: 0
property: ImpairmentParams
property default:
property: ImpairmentRepairReduction
property default: 0.3
property: ServiceCost
property default: 0
property: ServiceTime
property default: 0
property: ScheduledServicesForReplacement
property default: 1
property: ReplacedOnService
property default:
property: InspectionCost
property default: 0
property: InspectionTime
property default: 0
property: RepairCost
property default: 0
property: RepairTime
property default: 0
property: ReplaceCost
property default: 0
property: UnScheduledReplaceTime
property default: 0
property: ScheduledReplaceTime
property default: 0
property: HasMonitoring
property block
property attribute: SetAccess = private
property attribute: GetAccess = public
property: Age
property: RequiresRepair
property: RequiresReplacement
property: HasFailed
property: DamageDetectionProbability
property: TimeToRecovery
property: NReplicates
property: ServicesToSchedReplacement
property default: 0
property: DamageLevel
property: ImpairmentLevel
constructor
temp = oandm.component object
octave-cli:3> clear
deleting oandm.component object (handle)
octave-cli:4> cd <snip>/
warning: load_path: +oandm: No such file or directory
octave-cli:5> temp = oandm.component(1)
warning: load_path: +oandm: No such file or directory
meta.package query: component
constructor
temp = oandm.component object
octave-cli:6> pwd
warning: load_path: +oandm: No such file or directory
ans = /home/richard/src/<snip>
octave-cli:7> ls
warning: load_path: +oandm: No such file or directory
error: no such file, '/<snip>/+oandm/system.m'
error: called from:
error:   /usr/local/share/octave/3.7.5/m/miscellaneous/ls.m at line  
69, column 20
octave-cli:7>

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Richard Crozier
On 12/09/2013 11:43, Richard Crozier wrote:
> Quoting Richard Crozier <[hidden email]> on Thu, 12 Sep 2013
> 11:26:12 +0100:
>
>>
>> I'm using 498b2dd1bd56 (classdef).
>>
>
>

Ok, apologies, I've realised my errors where largely due to using
addpath(genpath('.')) when testing rather than the full path name. I
still think there may be a bug in there somewhere though, would it be
possible for octave to resolve paths to overcome the ingenuity of fools
such as myself?

Richard


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

John W. Eaton
Administrator
On 09/12/2013 07:05 AM, Richard Crozier wrote:

> On 12/09/2013 11:43, Richard Crozier wrote:
>> Quoting Richard Crozier <[hidden email]> on Thu, 12 Sep 2013
>> 11:26:12 +0100:
>>
>>>
>>> I'm using 498b2dd1bd56 (classdef).
>>>
>>
>>
>
> Ok, apologies, I've realised my errors where largely due to using
> addpath(genpath('.')) when testing rather than the full path name. I
> still think there may be a bug in there somewhere though, would it be
> possible for octave to resolve paths to overcome the ingenuity of fools
> such as myself?

What did addpath (genpath ('.')) do incorrectly?  Did it add + and @
directories to the path?  Should it not do that?  If not, is it genpath
or addpath that should be fixed?  Or should it just warn you?  I can see
arguments for all possibilities, but probably the only thing that
matters is WDMD, because if we don't do what Matlab does, we will likely
see bug reports about the differences.

jwe

Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Richard Crozier
On 12/09/2013 12:20, John W. Eaton wrote:

> On 09/12/2013 07:05 AM, Richard Crozier wrote:
>> On 12/09/2013 11:43, Richard Crozier wrote:
>>> Quoting Richard Crozier <[hidden email]> on Thu, 12 Sep 2013
>>> 11:26:12 +0100:
>>>
>>>>
>>>> I'm using 498b2dd1bd56 (classdef).
>>>>
>>>
>>>
>>
>> Ok, apologies, I've realised my errors where largely due to using
>> addpath(genpath('.')) when testing rather than the full path name. I
>> still think there may be a bug in there somewhere though, would it be
>> possible for octave to resolve paths to overcome the ingenuity of fools
>> such as myself?
>
> What did addpath (genpath ('.')) do incorrectly?  Did it add + and @
> directories to the path?  Should it not do that?  If not, is it genpath
> or addpath that should be fixed?  Or should it just warn you?  I can see
> arguments for all possibilities, but probably the only thing that
> matters is WDMD, because if we don't do what Matlab does, we will likely
> see bug reports about the differences.
>
> jwe
>
>


It added directories starting with '.' to the path. When I changed  
directory it could no longer find the paths, at least this is my guess  
at what is happening from the load path errors I am getting. I've  
checked and Matlab exhibits the same behaviour if you add relative  
paths, then change directory. addpath didn't do anything incorrectly,  
it did exactly what I asked, but I was asking something slightly silly.

However, further to this, I think there really is still some kind of  
issue with package folders in classdef, if I correctly add the package  
directory, I get issues:


richard@rc ~/src/nova_package $ octave-cli
warning: function ./+oandm/system.m shadows a built-in function
GNU Octave, version 3.7.5
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type 'news'.

octave-cli:1> addpath(genpath ("/home/richard/src/<snip>"))
warning: function  
/home/richard/src/nova_package/renewnet-foundry/matlab-octave/tb-multicore/gethostname.m shadows a built-in  
function
warning: function /home/richard/src/<snip>/+oandm/system.m shadows a  
built-in function
octave-cli:2> ls
class: system
superclass: handle
method block
constructor: system
method: evaluate
method: addcomponent
method: service
method: plotmaintenancescatter
method: plotrevenuescatter
method: plotnetrevenuescatter
property block
property attribute: SetAccess = protected
property attribute: GetAccess = public
property: Components
property default:
property: NReplicates
property: MaintenanceCosts
property: ComponentMaintenanceCosts
property: Revenue
property: NetRevenue
property: IntervalRevenue
property: ServiceInterval
property: InspectionInterval
property: ServiceFixedCost
property: ServiceIntervalRate
property: ServiceDurationParams
constructor
error: zeros: invalid data type specified
error: called from:
error:   /home/richard/src/nova_package/+oandm/system.m at line 57, column 35
deleting system object (handle)
error:   /usr/local/share/octave/3.7.5/m/miscellaneous/ls.m at line  
69, column 20
octave-cli:2>


Richard






--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

John W. Eaton
Administrator
On 09/12/2013 07:59 AM, Richard Crozier wrote:

> However, further to this, I think there really is still some kind of
> issue with package folders in classdef,

?Yes, I'm pretty sure it is not complete yet.

jwe

Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Richard Crozier
On 12/09/2013 13:19, John W. Eaton wrote:

> On 09/12/2013 07:59 AM, Richard Crozier wrote:
>
>> However, further to this, I think there really is still some kind of
>> issue with package folders in classdef,
>
> ?Yes, I'm pretty sure it is not complete yet.
>
> jwe
>
>

Yes, I'm just reporting experiences to feed into the development, and to
determine whether to report a bug. Sorry if this is a known issue.

Richard

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

bpabbott
Administrator
On Sep 12, 2013, at 8:28 AM, Richard Crozier wrote:

> On 12/09/2013 13:19, John W. Eaton wrote:
>
>> On 09/12/2013 07:59 AM, Richard Crozier wrote:
>>
>>> However, further to this, I think there really is still some kind of
>>> issue with package folders in classdef,
>>
>> ?Yes, I'm pretty sure it is not complete yet.
>>
>> jwe
>
> Yes, I'm just reporting experiences to feed into the development, and to determine whether to report a bug. Sorry if this is a known issue.
>
> Richard

I'd suggest bug reports only be filed for features that are complete.  Since classdef is a work in progress, perhaps bug reports can be avoided and tests of existing features and missing features be added instead.

You can look into the test/classdf directory to see what tests are already there.  The tests will also give you a pretty good impression of what currently works.

Ben


Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Richard Crozier
Quoting Ben Abbott <[hidden email]> on Thu, 12 Sep 2013 08:47:13 -0400:

> On Sep 12, 2013, at 8:28 AM, Richard Crozier wrote:
>
>> On 12/09/2013 13:19, John W. Eaton wrote:
>>
>>> On 09/12/2013 07:59 AM, Richard Crozier wrote:
>
> I'd suggest bug reports only be filed for features that are  
> complete.  Since classdef is a work in progress, perhaps bug reports  
> can be avoided and tests of existing features and missing features  
> be added instead.
>
> You can look into the test/classdf directory to see what tests are  
> already there.  The tests will also give you a pretty good  
> impression of what currently works.
>
> Ben
>

Ok, I'll take a look and in future do this.

Richard


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Michael Goffioul
In reply to this post by Richard Crozier
On Thu, Sep 12, 2013 at 7:59 AM, Richard Crozier <[hidden email]> wrote:
On 12/09/2013 12:20, John W. Eaton wrote:
On 09/12/2013 07:05 AM, Richard Crozier wrote:
On 12/09/2013 11:43, Richard Crozier wrote:
Quoting Richard Crozier <[hidden email]> on Thu, 12 Sep 2013
11:26:12 +0100:


I'm using 498b2dd1bd56 (classdef).




Ok, apologies, I've realised my errors where largely due to using
addpath(genpath('.')) when testing rather than the full path name. I
still think there may be a bug in there somewhere though, would it be
possible for octave to resolve paths to overcome the ingenuity of fools
such as myself?

What did addpath (genpath ('.')) do incorrectly?  Did it add + and @
directories to the path?  Should it not do that?  If not, is it genpath
or addpath that should be fixed?  Or should it just warn you?  I can see
arguments for all possibilities, but probably the only thing that
matters is WDMD, because if we don't do what Matlab does, we will likely
see bug reports about the differences.

jwe




It added directories starting with '.' to the path. When I changed directory it could no longer find the paths, at least this is my guess at what is happening from the load path errors I am getting. I've checked and Matlab exhibits the same behaviour if you add relative paths, then change directory. addpath didn't do anything incorrectly, it did exactly what I asked, but I was asking something slightly silly.

However, further to this, I think there really is still some kind of issue with package folders in classdef, if I correctly add the package directory, I get issues:


richard@rc ~/src/nova_package $ octave-cli

warning: function ./+oandm/system.m shadows a built-in function
GNU Octave, version 3.7.5
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type 'news'.

octave-cli:1> addpath(genpath ("/home/richard/src/<snip>"))
warning: function /home/richard/src/nova_package/renewnet-foundry/matlab-octave/tb-multicore/gethostname.m shadows a built-in function
warning: function /home/richard/src/<snip>/+oandm/system.m shadows a built-in function

Could you report what genpath ("/home/richard/src/<snip>") actually generates, or what's the content of path after the addpath call?

Michael.

Reply | Threaded
Open this post in threaded view
|

Re: classdef problems

Michael Goffioul
In reply to this post by Richard Crozier



On Thu, Sep 12, 2013 at 7:59 AM, Richard Crozier <[hidden email]> wrote:
On 12/09/2013 12:20, John W. Eaton wrote:
On 09/12/2013 07:05 AM, Richard Crozier wrote:
On 12/09/2013 11:43, Richard Crozier wrote:
Quoting Richard Crozier <[hidden email]> on Thu, 12 Sep 2013
11:26:12 +0100:


I'm using 498b2dd1bd56 (classdef).




Ok, apologies, I've realised my errors where largely due to using
addpath(genpath('.')) when testing rather than the full path name. I
still think there may be a bug in there somewhere though, would it be
possible for octave to resolve paths to overcome the ingenuity of fools
such as myself?

What did addpath (genpath ('.')) do incorrectly?  Did it add + and @
directories to the path?  Should it not do that?  If not, is it genpath
or addpath that should be fixed?  Or should it just warn you?  I can see
arguments for all possibilities, but probably the only thing that
matters is WDMD, because if we don't do what Matlab does, we will likely
see bug reports about the differences.

jwe




It added directories starting with '.' to the path. When I changed directory it could no longer find the paths, at least this is my guess at what is happening from the load path errors I am getting. I've checked and Matlab exhibits the same behaviour if you add relative paths, then change directory. addpath didn't do anything incorrectly, it did exactly what I asked, but I was asking something slightly silly.

However, further to this, I think there really is still some kind of issue with package folders in classdef, if I correctly add the package directory, I get issues:


richard@rc ~/src/nova_package $ octave-cli

warning: function ./+oandm/system.m shadows a built-in function
GNU Octave, version 3.7.5
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.

For information about changes from previous versions, type 'news'.

octave-cli:1> addpath(genpath ("/home/richard/src/<snip>"))
warning: function /home/richard/src/nova_package/renewnet-foundry/matlab-octave/tb-multicore/gethostname.m shadows a built-in function
warning: function /home/richard/src/<snip>/+oandm/system.m shadows a built-in function

octave-cli:2> ls
class: system
superclass: handle
method block
constructor: system
method: evaluate
method: addcomponent
method: service
method: plotmaintenancescatter
method: plotrevenuescatter
method: plotnetrevenuescatter
property block
property attribute: SetAccess = protected

property attribute: GetAccess = public
property: Components
property default:
property: NReplicates
property: MaintenanceCosts
property: ComponentMaintenanceCosts
property: Revenue
property: NetRevenue
property: IntervalRevenue
property: ServiceInterval
property: InspectionInterval
property: ServiceFixedCost
property: ServiceIntervalRate
property: ServiceDurationParams
constructor
error: zeros: invalid data type specified
error: called from:
error:   /home/richard/src/nova_package/+oandm/system.m at line 57, column 35
deleting system object (handle)

error:   /usr/local/share/octave/3.7.5/m/miscellaneous/ls.m at line 69, column 20
octave-cli:2>

This changeset should fix the problem:


Michael.