Developer FAQ: Difference between revisions

From Octave
Jump to navigation Jump to search
(Finding source for a given function)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
1. ''How can I find which file implements a given command?''
== How can I get involved in Octave development? ==


From within Octave, use 'which':
* <p>'''Be around.  Be social.'''</p><p>Participate in our mailing lists [https://lists.gnu.org/mailman/listinfo/help-octave help@octave.org] and [https://lists.gnu.org/mailman/listinfo/octave-maintainers maintainers@octave.org].  Find things about Octave you don't like, and start thinking about how to fix them. '''But do not send an email to the mailing lists listing your skills and offering to help.'''</p><p>Many people who now contribute to Octave first spent several years helping in the mailing list before they started to delve into the code.  A good way to learn Octave is to understand the problems other people are having with it, so being helpful in the mailing lists not only helps Octave as a whole, but it also prepares you to be a better Octave contributor.</p>
  octave:1> which addpath
 
'addpath' is a built-in function from the file libinterp/corefcn/load-path.cc
* <p>'''Kill the bugs.'''</p><p>Accurate bug reporting is also very useful.  Find and report [http://bugs.octave.org/ bugs], making an attempt to diagnose them.  Eventually, you will also know how to fix them.  If you want to help with bug reports or patches, subscribe to the [https://lists.gnu.org/mailman/listinfo/octave-bug-tracker bug tracker mailing list].  You'll get updates on all bug activity, and you can jump in when you see something you can help with.</p>
While editing the file, the function definition usually matches a regular expression like
 
^(addpath,
* <p>'''Getting hands dirty.'''</p><p>See [[#How can I contribute code to Octave?]] below. We lack volunteers and '''we do need your help''', but because of that, we also lack the time to provide good guidance and mentoring.  If there is a specific short-term project you would like to work on, say so, and '''just do it'''.  Then ask for help or advice when you're doing it.  It is a lot more important that you do something that you're actually interested on than something we suggested because it only matches your skills.</p>
(The '(' may need to be escaped, depending on the flavour of regular expression used.)
 
* <p>'''Octave needs more documentation.'''</p><p>If you like documenting software or have great ideas for Octave, please get in contact with us. Additionally, see [[Project - Documentation]] for details.</p>
 
* <p>'''Need inspiration?'''</p><p>Look at our [[projects]], [[short projects]], and [[Summer of Code - Getting Started]] if you need specific inspiration for coding tasks that we would like to get done.</p>
 
== How can I contribute code to Octave? ==
 
In general you can contribute code to Octave in form of '''patches (changesets)'''.  Those have to be uploaded to the [https://savannah.gnu.org/bugs/?group=octave bug] or [https://savannah.gnu.org/patch/?group=octave patch] tracker.
 
* In [[Building]] is described, how you get and build the latest Octave source code on your system.
* In [[Mercurial]] we describe, how you create a patch (changeset) from your modifications.
* Our [[Contribution guidelines]] should be read and followed as well, to ensure acceptance of your contribution.
 
== How can I find which source file implements a given command? ==
 
Use Octave's  {{manual|which}} command.
 
=== m-file functions ===
 
<syntaxhighlight lang="Octave">
>> which help
</syntaxhighlight>
 
  'help' is a function from the file /some/path/m/help/help.m
 
In this case, the desired function is a m-file, one can simply edit it inside the GUI, just type:
 
<syntaxhighlight lang="Octave">
>> edit help
</syntaxhighlight>
 
=== built-in functions ===
 
Some functions are already compiled (a.k.a. ''built-in functions''), for example:
 
<syntaxhighlight lang="Octave">
>> which addpath
</syntaxhighlight>
 
  'addpath' is a built-in function from the file libinterp/corefcn/load-path.cc
 
This function is to be found in Octave's source code, in this case at {{Path|[https://hg.savannah.gnu.org/hgweb/octave/file/b33d4fbce33e/libinterp/corefcn/load-path.cc#l2355 libinterp/corefcn/load-path.cc]}}. Open the respective file with an editor of your choice and search for the pattern "<code> (addpath,</code>".
 
[[Category:Development]]
[[Category:FAQ]]

Revision as of 06:42, 11 June 2020

How can I get involved in Octave development?

  • Be around. Be social.

    Participate in our mailing lists help@octave.org and maintainers@octave.org. Find things about Octave you don't like, and start thinking about how to fix them. But do not send an email to the mailing lists listing your skills and offering to help.

    Many people who now contribute to Octave first spent several years helping in the mailing list before they started to delve into the code. A good way to learn Octave is to understand the problems other people are having with it, so being helpful in the mailing lists not only helps Octave as a whole, but it also prepares you to be a better Octave contributor.

  • Kill the bugs.

    Accurate bug reporting is also very useful. Find and report bugs, making an attempt to diagnose them. Eventually, you will also know how to fix them. If you want to help with bug reports or patches, subscribe to the bug tracker mailing list. You'll get updates on all bug activity, and you can jump in when you see something you can help with.

  • Getting hands dirty.

    See #How can I contribute code to Octave? below. We lack volunteers and we do need your help, but because of that, we also lack the time to provide good guidance and mentoring. If there is a specific short-term project you would like to work on, say so, and just do it. Then ask for help or advice when you're doing it. It is a lot more important that you do something that you're actually interested on than something we suggested because it only matches your skills.

  • Octave needs more documentation.

    If you like documenting software or have great ideas for Octave, please get in contact with us. Additionally, see Project - Documentation for details.

How can I contribute code to Octave?

In general you can contribute code to Octave in form of patches (changesets). Those have to be uploaded to the bug or patch tracker.

  • In Building is described, how you get and build the latest Octave source code on your system.
  • In Mercurial we describe, how you create a patch (changeset) from your modifications.
  • Our Contribution guidelines should be read and followed as well, to ensure acceptance of your contribution.

How can I find which source file implements a given command?

Use Octave's which command.

m-file functions

>> which help
 'help' is a function from the file /some/path/m/help/help.m

In this case, the desired function is a m-file, one can simply edit it inside the GUI, just type:

>> edit help

built-in functions

Some functions are already compiled (a.k.a. built-in functions), for example:

>> which addpath
 'addpath' is a built-in function from the file libinterp/corefcn/load-path.cc

This function is to be found in Octave's source code, in this case at libinterp/corefcn/load-path.cc. Open the respective file with an editor of your choice and search for the pattern " (addpath,".