[Scilab-users] New function for scilab to matlab conversion

classic Classic list List threaded Threaded
6 messages Options
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] New function for scilab to matlab conversion

Hi all,

I am trying to convert some old matlab code to scilab.
Running m2sci, I noticed that some simple functions were not available in scilab (pol2car for example).
I just did a small clean-room reimplementation of pol2car and tested on the official examples that it behaves like the matlab one.
(nothing fancy at all!).

Here are my questions:
(1) Is there any official way to propose the addition of pol2car to scilab ? (Not sure this is worth a SEP)
(2) Is there some official coding style or additional test that I should provide?

Thank you in advance,

Antoine
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: New function for scilab to matlab conversion

Hi Antoine,

Did you already setup a git repository and its pushurl to codereview.scilab.org ? If not, please follow https://wiki.scilab.org/gerrit .

If yes, for small changes like pol2cart(), you could simply push the macro, the help page and a unit test ; we will then start the discussion on the code and merge it. For more important changes (multiple functions, modules, Scilab global behavior, etc...) it should be good to write a SEP for better, long-term, information.

Note: I did not look for any equivalent function but it looks strange to me to not already have it.

Thanks,

--
Clément

> -----Original Message-----
> From: users <[hidden email]> On Behalf Of Antoine
> Monmayrant
> Sent: Tuesday, March 10, 2020 9:32 AM
> To: Users mailing list for Scilab <[hidden email]>
> Subject: [Scilab-users] New function for scilab to matlab conversion
>
> Hi all,
>
> I am trying to convert some old matlab code to scilab.
> Running m2sci, I noticed that some simple functions were not available in scilab
> (pol2car for example).
> I just did a small clean-room reimplementation of pol2car and tested on the
> official examples that it behaves like the matlab one.
> (nothing fancy at all!).
>
> Here are my questions:
> (1) Is there any official way to propose the addition of pol2car to scilab ? (Not
> sure this is worth a SEP)
> (2) Is there some official coding style or additional test that I should provide?
>
> Thank you in advance,
>
> Antoine
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? New function for scilab to matlab conversion

Le Mardi, Mars 10, 2020 10:07 CET, Clément David <[hidden email]> a écrit:
 
> Hi Antoine,
>
> Did you already setup a git repository and its pushurl to codereview.scilab.org ? If not, please follow https://wiki.scilab.org/gerrit .
>

OK, thanks for the pointer.

> If yes, for small changes like pol2cart(), you could simply push the macro, the help page and a unit test ; we will then start the discussion on the code and merge it. For more important changes (multiple functions, modules, Scilab global behavior, etc...) it should be good to write a SEP for better, long-term, information.
>

That makes sense.
Is there any wiki/doc documenting the whole process?

> Note: I did not look for any equivalent function but it looks strange to me to not already have it.

Well, I first relied on what m2sci said. I had a quick glance but did not find anything.
I'll have another look, it's maybe that m2sci is not aware of such a function.

Thank you,

Antoine

>
> Thanks,
>
> --
> Clément
>
> > -----Original Message-----
> > From: users <[hidden email]> On Behalf Of Antoine
> > Monmayrant
> > Sent: Tuesday, March 10, 2020 9:32 AM
> > To: Users mailing list for Scilab <[hidden email]>
> > Subject: [Scilab-users] New function for scilab to matlab conversion
> >
> > Hi all,
> >
> > I am trying to convert some old matlab code to scilab.
> > Running m2sci, I noticed that some simple functions were not available in scilab
> > (pol2car for example).
> > I just did a small clean-room reimplementation of pol2car and tested on the
> > official examples that it behaves like the matlab one.
> > (nothing fancy at all!).
> >
> > Here are my questions:
> > (1) Is there any official way to propose the addition of pol2car to scilab ? (Not
> > sure this is worth a SEP)
> > (2) Is there some official coding style or additional test that I should provide?
> >
> > Thank you in advance,
> >
> > Antoine
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? New function for scilab to matlab conversion

> > If yes, for small changes like pol2cart(), you could simply push the macro, the
> help page and a unit test ; we will then start the discussion on the code and
> merge it. For more important changes (multiple functions, modules, Scilab
> global behavior, etc...) it should be good to write a SEP for better, long-term,
> information.
> >
>
> That makes sense.
> Is there any wiki/doc documenting the whole process?

No, not really, there are some pages on the wiki but it slightly depends on the kind of function you developed. As we validate the commits with a review, the codereview let us iterate and discuss changes very easily.

--
Clément
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? ?==?utf-8?q? ?= New function for scilab to matlab conversio

Clément,

I had a look at gerrit, it's a bit overwhelming.
I don't want to add unnecessary noise to the git log.
I am not even sure about:
(1) the number / nature of the files I am supposed to make. So far, I though about:
  - the macro itself 'pol2cart.sci'
  - the xml file to describe the help page 'pol2cart.xml'
  - some test files.
(2) the hierarchical structure of the contribution: which file goes where.

If any of you can share any piece of advice about the two points above, I'll appreciate greatly.

Do you think making a dumb atoms module around this simple function could help me get all the required files and sorted as expected?

Antoine
 
Le Mardi, Mars 10, 2020 10:43 CET, Clément David <[hidden email]> a écrit:
 

> > > If yes, for small changes like pol2cart(), you could simply push the macro, the
> > help page and a unit test ; we will then start the discussion on the code and
> > merge it. For more important changes (multiple functions, modules, Scilab
> > global behavior, etc...) it should be good to write a SEP for better, long-term,
> > information.
> > >
> >
> > That makes sense.
> > Is there any wiki/doc documenting the whole process?
>
> No, not really, there are some pages on the wiki but it slightly depends on the kind of function you developed. As we validate the commits with a review, the codereview let us iterate and discuss changes very easily.
>
> --
> Clément
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Clément David-3 Clément David-3
Reply | Threaded
Open this post in threaded view
|

Re: ?= ?==?utf-8?q? New function for scilab to matlab conversio

Hello Antoine,

Don't worry to iterate on the codereview, this is the way to go to add simple function like pol2cart. Even if you are using git, this is not the final git log until validation!

About the sub-directory (eg. module) to put your macro into, I suggest you use "elementary_functions":
 1. Put the pol2cart.sci file into SCI/modules/elementary_functions/macros
 2. Put the pol2cart.xml English help page into SCI/modules/elementary_functions/help/en_US/trigonometry
 3. Put the pol2cart.tst unit test file into SCI/modules/elementary_functions/tests/unit_tests/

And that's it for the files! For the review, git add the new files and git push to the codereview.

Note: creating a dedicated ATOMS toolbox will involve more work 😊
Note2: a default xml help file could be generated from Scilab code comments using help_from_sci()

--
Clément

> -----Original Message-----
> From: users <[hidden email]> On Behalf Of Antoine
> Monmayrant
> Sent: Monday, March 16, 2020 5:07 PM
> To: Users mailing list for Scilab <[hidden email]>
> Subject: Re: [Scilab-users] ?==?utf-8?q? ?==?utf-8?q? ?= New function for scilab
> to matlab conversio
>
> Clément,
>
> I had a look at gerrit, it's a bit overwhelming.
> I don't want to add unnecessary noise to the git log.
> I am not even sure about:
> (1) the number / nature of the files I am supposed to make. So far, I though
> about:
>   - the macro itself 'pol2cart.sci'
>   - the xml file to describe the help page 'pol2cart.xml'
>   - some test files.
> (2) the hierarchical structure of the contribution: which file goes where.
>
> If any of you can share any piece of advice about the two points above, I'll
> appreciate greatly.
>
> Do you think making a dumb atoms module around this simple function could
> help me get all the required files and sorted as expected?
>
> Antoine
>
> Le Mardi, Mars 10, 2020 10:43 CET, Clément David <Clement.David@esi-
> group.com> a écrit:
>
> > > > If yes, for small changes like pol2cart(), you could simply push the macro,
> the
> > > help page and a unit test ; we will then start the discussion on the code and
> > > merge it. For more important changes (multiple functions, modules, Scilab
> > > global behavior, etc...) it should be good to write a SEP for better, long-term,
> > > information.
> > > >
> > >
> > > That makes sense.
> > > Is there any wiki/doc documenting the whole process?
> >
> > No, not really, there are some pages on the wiki but it slightly depends on the
> kind of function you developed. As we validate the commits with a review, the
> codereview let us iterate and discuss changes very easily.
> >
> > --
> > Clément
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.scilab.org/mailman/listinfo/users
> >
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users