[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing functions in the statistics package.

From: Oliver Heimlich
Subject: Re: Missing functions in the statistics package.
Date: Sun, 13 Sep 2015 16:27:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0

On 13.09.2015 11:52, Dag wrote:
Thanks everyone for your help.

There are many ways to write and test code. I have this procedure in mind:

1. Download the source code of Octave and do a local installation.

I downloaded v. 3.8.2 and compiled it in Linux Mint after installing
relevant Debian packages ( http://wiki.octave.org/Octave_for_Debian_systems
<http://wiki.octave.org/Octave_for_Debian_systems>  ). All the tests run by
"make check" complete successfully.

When you plan to contribute to the source code, you should not get the source tarball, but clone the source repository into a local workspace. You will then be able to create patches for the maintainers. If you make changes to version 3.8.2, it might become impossible to apply them to the upcoming 4.2.0.

If you are only contributing to packages, you could install any reasonably recent octave version, preferably from the package repositories of your distribution.

2. Make a local installation of the package to be edited.

I installed the statistics package v. 1.2.4 using the command  "pkg install
-local statistics-1.2.4.tar.gz". It loads successfully.

Again, if you plan to make changes to the packages, it is much easier to clone the source repository and export patches. There have been several changes to the source code since the 1.2.4 release of the statistics package.

3. Make some edits of code including test cases and reinstall (uninstall +
install) the relevant package.

When you have a local clone of the package's repository, you can use `make run` to experiment with the package without (re-)installing all the time. Whether `make run` is available for a particular package depends, but the statistics package has it.

4. Run tests and see if there are any errors.

5. Run 3-4 iteratively until the goal has been attained and there are no
known bugs.


6. Upload code to a repository or something.

You could push your modified version to a private repository or provide patches for the official repository. Later it will be possible to grant push access to the official repository if you plan more substantial contributions.

I am about to start doing step 3 now. I will take a look at the code
guidelines and internal information that you have and proceed accordingly.

Some questions:

* An attempt to run all the tests ("make check") failed with Octave 4.0.0,
so I cannot test my code there. But since I am not dealing with the core,
this may not be important until at a later stage.

You should file a bug report for octave, unless the error is already known or caused by some misconfiguration.

* I have an Octave installation that comes with Linux Mint packages. But I
do not want to make changes to this one when doing my coding, because I need
a stable installation for other purposes. I will be using the local
installation for code writing and testing.

When you have several octave versions on your machine, you have to export OCTAVE and MKOCTFILE environment variables and make them point to the correct binaries. Otherwise working with the package sources might fail because the wrong mkoctfile version is used in combination with a particular octave version.

* Bounds checking is good for debugging purposes. I will try this and
reinstall my local Octave if it makes debugging easier.

* I am used to writing code in Eclipse and save them with git. There is no
indication that Octave programmers are using these tools. Should I just make
edits in a simple text editor and reinstall iteratively the package being

Most of our repositories use mercurial instead of git. You can use whatever editor you prefer. For example you should have mercurial integration in Eclipse. Instead of reinstalling the package, you can use `make run` to see your changes to the source code in action.

* I can run "make check" for testing Octave core. But how do I test a

Just like `make run` you can use `make check` for some packages. You have to clone the official source repository, because the Makefile is not included in the package tarball.

To test an installed package, you could use
>> pkg load statistics
>> __run_test_suite__ ({'octave/statistics-1.2.4/'}, {})

  PASS       223
  FAIL        21

* As for coding, I was thinking of writing the prob.* statistical functions
listed in  http://wiki.octave.org/Statistics_package
<http://wiki.octave.org/Statistics_package>  . If this succeeds and is fun,
I will be doing more later. But what do the functions entail? Is it random
number generation, PDFs, or CDFs? Are they based on function declarations in
Matlab? MathWorks has got a lot of information on the Internet. Where can I
find are the function declarations in that case? (If we are writing
independent code, this does not apply and we will make our own.)

If you implement a function that is also available in matlab or one of its toolboxes, you should make sure that its interface is compatible, so user code can run in octave without much rewriting.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]