Quantcast

Missing functions in "Mapping package"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Missing functions in "Mapping package"

Mithil
Hello

I saw that "Mapping" package has quite a lot of missing functions.
http://wiki.octave.org/Mapping_package
Some of them could be implemented easily, I suppose. But all of them lack their function signature. Do they follow the same signature as in "MATLAB Mapping" package?

https://in.mathworks.com/help/map/functionlist.html

Kindly confirm this and let me know if there are any particular steps to follow for submission.

Thanks
Mithil

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing functions in "Mapping package"

PhilipNienhuis
Hi there,

(mapping pkg maintainer here)

Mithil wrote
Hello

I saw that "Mapping" package has quite a lot of missing functions.
http://wiki.octave.org/Mapping_package
Some of them could be implemented easily, I suppose. But all of them lack their function signature. Do they follow the same signature as in "MATLAB Mapping" package?

https://in.mathworks.com/help/map/functionlist.html

Kindly confirm this and let me know if there are any particular steps to follow for submission.
Thank you very much for your offer to contribute, of course we would be happy with your contributions. I do hope you would comply with some basic coding style and license requirements.

I'm unsure what you mean with "function signature"?

First of all I have pushed several new functions since the last release, see the repo on SF:
https://sourceforge.net/p/octave/mapping/ci/default/tree/
and especially the latest updated list of function in the pkg's INDEX file:
https://sourceforge.net/p/octave/mapping/ci/default/tree/INDEX

Furthermore there are several outstanding patches in the patch tracker
 https://savannah.gnu.org/patch/?group=octave
that I haven't accepted yet because of things like missing copyright info, suboptimal coding style, sometimes naive implementation, low level of vectorization, incomplete or erroneous texinfo documentation, etc.  I do want to accept those later on but they first need work that the (anonymous) original author apparently isn't interested to do and I still haven't had time & priority to do that either.
Just search for "octave mapping" in the patch tracker for a start.

Polygon / polyline clipping functions (boolean ops) need work as well but that is done in the geometry package. See patch #9000 (about to be closed soon I hope) and various mailing list discussions. This is a complicated issue.

GIS raster file reading has been implemented using "rasterread", covering all (and probably much more) raster file formats than Matlab' s mapping toolbox supports. Writing raster files is still pending but IMO has low priority.
My stance is that Octave + mapping toolbox shouldn't try to be a GIS system - there are very good OSS GIS programs out there, no need to reinvent the wheel.

Felipe Nievinsky has a geodesy toolbox with (IIRC:) BSD style license, Matlab-compatible, that could be very useful for adding projections. But those functions need work as well (most of all documentation). Someone ("Sandeep") has started converting them into octave coding style. Again see patch tracker,
https://savannah.gnu.org/patch/?func=detailitem&item_id=8377#options
Carnë and Felipe suggested to use Felipe's repo as an upstream development and from time to time just copy those functions over. Could be a viable idea, but it needs good thinking over.

So all in all I think it would be wise to start off with some simple conversion functions in .m file format and add them to the patch tracker for review.

Note that I plan to make a new mapping package release within 1-2 months. But OK, plans ...

Thanks,

Philip Nienhuis
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing functions in "Mapping package"

Mithil
Hello

Thanks for your precious reply.

As a beginner to open source, I would like to start with some very elementary contributions in the beginning.

Function signature which I mentioned in the previous mail meant "Function definition and specification" which includes input-output relation, parameters and their types and return value and their types.

To begin with, I created one of the most basic script possible out of the given missing functions list. Now, what should I do?
Should I just submit a new patch here https://savannah.gnu.org/patch/?func=additem&group=octave ?

Thanks in advance. I hope I could contribute something meaningful to the community.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing functions in "Mapping package"

NJank
On Fri, Mar 24, 2017 at 2:34 PM, Mithil <[hidden email]> wrote:
Hello

Thanks for your precious reply.

As a beginner to open source, I would like to start with some very
elementary contributions in the beginning.

Function signature which I mentioned in the previous mail meant "Function
definition and specification" which includes input-output relation,
parameters and their types and return value and their types.


I haven't worked on this package, but the following is my general understanding which may answer some of your questions:

For function definition as you define it, you will require some knowledge of the intended function. Often the expected behavior is defined as 'matlab compatible input, output, and syntax'. I.e., if a command runs under Matlab, ideally Octave could produce the same output from the same commands. In those cases the intended functional behavior can usually be determined from the Mathworks.com public facing documentation for the function you're working on, including expected input/output syntax, examples, etc. If you have access to Matlab you can do some trial and error yourself with function inputs/outputs, but DO NOT open any matlab functions to see their algorithms. Their code is not free and copying their algorithms would be a violation of their copyright.

If you do not have matlab access and the documentation is insufficient to answer certain questions, you can make a test script, post it to the patch tracker and/or mailing list, and request someone send you the output from matlab.

For proper form, assuming you're doing m-file coding, you can start by opening the Octave editor and selecting File/New/New Function.   It will prompt you for a function name and give you a fairly decent starting template for the function. The default copyright notice will be at the top.  There will be a texinfo block for documentation, Author info will be placed after than, and then the function/endfunction block should contain the actual code. you can change the input/output form/variable names/etc to whatever makes the most sense in your case.

Preferred coding style/conventions can be found here:
http://wiki.octave.org/Octave_style_guide

After the endfunction line, built in tests should be added. These are tests for expected input handling, output, error cases, etc., and can be run by others to make sure any other changes don't break this function. Each function should have at least one test. Demo's can also be added for functions that warrant it. Would recommend peeking at some of the other Octave functions to see examples of these and documentation formatting.
https://www.gnu.org/software/octave/doc/v4.2.1/Test-and-Demo-Functions.html#Test-and-Demo-Functions

Once you get a handle on coding m-files for octave, contributing would follow the guidelines here
https://octave.sourceforge.io/developers.html

Philip and others may correct me, especially with regards to this package, but that's the understanding of the process I've been operating on. Hope it helps.

Nick Jankowski

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing functions in "Mapping package"

PhilipNienhuis
NJank wrote
On Fri, Mar 24, 2017 at 2:34 PM, Mithil <[hidden email]> wrote:

> Hello
>
> Thanks for your precious reply.
>
> As a beginner to open source, I would like to start with some very
> elementary contributions in the beginning.
>
> Function signature which I mentioned in the previous mail meant "Function
> definition and specification" which includes input-output relation,
> parameters and their types and return value and their types.
>


I haven't worked on this package, but the following is my general
understanding which may answer some of your questions:

For function definition as you define it, you will require some knowledge
of the intended function. Often the expected behavior is defined as 'matlab
compatible input, output, and syntax'. I.e., if a command runs under
Matlab, ideally Octave could produce the same output from the same
commands. In those cases the intended functional behavior can usually be
determined from the Mathworks.com public facing documentation for the
function you're working on, including expected input/output syntax,
examples, etc. If you have access to Matlab you can do some trial and error
yourself with function inputs/outputs, but DO NOT open any matlab functions
to see their algorithms. Their code is not free and copying their
algorithms would be a violation of their copyright.

If you do not have matlab access and the documentation is insufficient to
answer certain questions, you can make a test script, post it to the patch
tracker and/or mailing list, and request someone send you the output from
matlab.

For proper form, assuming you're doing m-file coding, you can start by
opening the Octave editor and selecting File/New/New Function.   It will
prompt you for a function name and give you a fairly decent starting
template for the function. The default copyright notice will be at the
top.  There will be a texinfo block for documentation, Author info will be
placed after than, and then the function/endfunction block should contain
the actual code. you can change the input/output form/variable names/etc to
whatever makes the most sense in your case.

Preferred coding style/conventions can be found here:
http://wiki.octave.org/Octave_style_guide

After the endfunction line, built in tests should be added. These are tests
for expected input handling, output, error cases, etc., and can be run by
others to make sure any other changes don't break this function. Each
function should have at least one test. Demo's can also be added for
functions that warrant it. Would recommend peeking at some of the other
Octave functions to see examples of these and documentation formatting.
https://www.gnu.org/software/octave/doc/v4.2.1/Test-and-Demo-Functions.html#Test-and-Demo-Functions

Once you get a handle on coding m-files for octave, contributing would
follow the guidelines here
https://octave.sourceforge.io/developers.html

Philip and others may correct me, especially with regards to this package,
but that's the understanding of the process I've been operating on. Hope it
helps.
Thanks Nick,

I think that's a pretty accurate write-up.

Philip
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing functions in "Mapping package"

Juan Pablo Carbajal-2
On Fri, Mar 24, 2017 at 9:02 PM, PhilipNienhuis <[hidden email]> wrote:

> NJank wrote
>> On Fri, Mar 24, 2017 at 2:34 PM, Mithil &lt;
>
>> mithilleua@
>
>> &gt; wrote:
>>
>>> Hello
>>>
>>> Thanks for your precious reply.
>>>
>>> As a beginner to open source, I would like to start with some very
>>> elementary contributions in the beginning.
>>>
>>> Function signature which I mentioned in the previous mail meant "Function
>>> definition and specification" which includes input-output relation,
>>> parameters and their types and return value and their types.
>>>
>>
>>
>> I haven't worked on this package, but the following is my general
>> understanding which may answer some of your questions:
>>
>> For function definition as you define it, you will require some knowledge
>> of the intended function. Often the expected behavior is defined as
>> 'matlab
>> compatible input, output, and syntax'. I.e., if a command runs under
>> Matlab, ideally Octave could produce the same output from the same
>> commands. In those cases the intended functional behavior can usually be
>> determined from the Mathworks.com public facing documentation for the
>> function you're working on, including expected input/output syntax,
>> examples, etc. If you have access to Matlab you can do some trial and
>> error
>> yourself with function inputs/outputs, but DO NOT open any matlab
>> functions
>> to see their algorithms. Their code is not free and copying their
>> algorithms would be a violation of their copyright.
>>
>> If you do not have matlab access and the documentation is insufficient to
>> answer certain questions, you can make a test script, post it to the patch
>> tracker and/or mailing list, and request someone send you the output from
>> matlab.
>>
>> For proper form, assuming you're doing m-file coding, you can start by
>> opening the Octave editor and selecting File/New/New Function.   It will
>> prompt you for a function name and give you a fairly decent starting
>> template for the function. The default copyright notice will be at the
>> top.  There will be a texinfo block for documentation, Author info will be
>> placed after than, and then the function/endfunction block should contain
>> the actual code. you can change the input/output form/variable names/etc
>> to
>> whatever makes the most sense in your case.
>>
>> Preferred coding style/conventions can be found here:
>> http://wiki.octave.org/Octave_style_guide
>>
>> After the endfunction line, built in tests should be added. These are
>> tests
>> for expected input handling, output, error cases, etc., and can be run by
>> others to make sure any other changes don't break this function. Each
>> function should have at least one test. Demo's can also be added for
>> functions that warrant it. Would recommend peeking at some of the other
>> Octave functions to see examples of these and documentation formatting.
>> https://www.gnu.org/software/octave/doc/v4.2.1/Test-and-Demo-Functions.html#Test-and-Demo-Functions
>>
>> Once you get a handle on coding m-files for octave, contributing would
>> follow the guidelines here
>> https://octave.sourceforge.io/developers.html
>>
>> Philip and others may correct me, especially with regards to this package,
>> but that's the understanding of the process I've been operating on. Hope
>> it
>> helps.
>
> Thanks Nick,
>
> I think that's a pretty accurate write-up.
>
> Philip
>
>
>
> --
> View this message in context: http://octave.1599824.n4.nabble.com/Missing-functions-in-Mapping-package-tp4682599p4682612.html
> Sent from the Octave - Maintainers mailing list archive at Nabble.com.
>
To add a short answer to the original author: Yes, if the function
exists in matlab please use the same function signature (and try to
make it return the same, see Nick's answer on this).

Loading...