Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement Matlab to Python Translator #17

Draft
wants to merge 65 commits into
base: 27-generate-unit-tests-for-cpdassignustar
Choose a base branch
from

Conversation

tztsai
Copy link

@tztsai tztsai commented Aug 8, 2024

A translator from matlab code to python 2 code is implemented in the smop/ folder, adopted from the smop repository. A bash script m2py.sh is also added to automate the translation process and save the translated files in oneflux_steps/ustar_cp_py/. It will also run all the current pytest suit against the translated code.

To run the translation and testing, simply run bash m2py.sh.

@tztsai
Copy link
Author

tztsai commented Aug 8, 2024

Further comment: an automatic workflow of translating matlab code to python might be useful if we want to work on the matlab code to add tests, etc. like in PR #15.

@tztsai tztsai self-assigned this Aug 22, 2024
@tztsai tztsai changed the base branch from main to 37-modularise-cpdBoostrap October 21, 2024 10:47
@tztsai tztsai changed the title [WIP] Use smop to Translate Matlab Code to Python 2 [WIP] Use smop to Translate Matlab Code to Python Oct 23, 2024
@tztsai tztsai changed the title [WIP] Use smop to Translate Matlab Code to Python [WIP] Implement Matlab to Python Translator Oct 23, 2024
@dorchard
Copy link
Member

This also updates from Python 2 to 3 using the 2to3 tool.

@tztsai tztsai changed the base branch from 37-modularise-cpdBoostrap to 27-generate-unit-tests-for-cpdassignustar October 28, 2024 19:19
…-except for Stats initialization; update import statements in smop modules
commit e94a521
Author: tztsai <[email protected]>
Date:   Thu Nov 14 13:45:28 2024 +0000

    Merge branch '27-generate-unit-tests-for-cpdassignustar' into test_and_refactor_cpdFmax2pCp3

commit 87e2526
Author: James Emberton <[email protected]>
Date:   Thu Nov 14 09:34:58 2024 +0000

    convert matlab to python

commit e72d639
Author: James Emberton <[email protected]>
Date:   Thu Nov 14 09:19:29 2024 +0000

    modified tests

commit 2cd15d3
Author: James Emberton <[email protected]>
Date:   Mon Nov 11 11:59:54 2024 +0000

    modularised function

commit 1e69989
Author: James Emberton <[email protected]>
Date:   Mon Nov 11 11:46:48 2024 +0000

    added initial tests

commit 44bfb80
Author: James Emberton <[email protected]>
Date:   Mon Oct 28 10:30:47 2024 +0000

    setup stats reset to original code logic

commit 69afcbb
Merge: 65aaafb 4d83e33
Author: Dominic Orchard <[email protected]>
Date:   Thu Oct 24 15:52:10 2024 +0100

    Merge pull request #41 from Cambridge-ICCS/change_ustar_cp_scope

    Change ustar_cp scope to 'session'

commit 4d83e33
Author: isaac <[email protected]>
Date:   Tue Oct 22 10:58:15 2024 +0100

    Change ustar_cp scope to 'session'
commit e94a521
Author: tztsai <[email protected]>
Date:   Thu Nov 14 13:45:28 2024 +0000

    Merge branch '27-generate-unit-tests-for-cpdassignustar' into test_and_refactor_cpdFmax2pCp3

commit 87e2526
Author: James Emberton <[email protected]>
Date:   Thu Nov 14 09:34:58 2024 +0000

    convert matlab to python

commit e72d639
Author: James Emberton <[email protected]>
Date:   Thu Nov 14 09:19:29 2024 +0000

    modified tests

commit 2cd15d3
Author: James Emberton <[email protected]>
Date:   Mon Nov 11 11:59:54 2024 +0000

    modularised function

commit 1e69989
Author: James Emberton <[email protected]>
Date:   Mon Nov 11 11:46:48 2024 +0000

    added initial tests

commit 44bfb80
Author: James Emberton <[email protected]>
Date:   Mon Oct 28 10:30:47 2024 +0000

    setup stats reset to original code logic

commit 69afcbb
Merge: 65aaafb 4d83e33
Author: Dominic Orchard <[email protected]>
Date:   Thu Oct 24 15:52:10 2024 +0100

    Merge pull request #41 from Cambridge-ICCS/change_matlab_engine_scope

    Change matlab_engine scope to 'session'

commit 4d83e33
Author: isaac <[email protected]>
Date:   Tue Oct 22 10:58:15 2024 +0100

    Change matlab_engine scope to 'session'
@tztsai tztsai closed this Nov 21, 2024
@tztsai tztsai deleted the m2py-auto branch November 21, 2024 15:52
@omarjamil omarjamil restored the m2py-auto branch November 21, 2024 16:53
@tztsai tztsai reopened this Dec 3, 2024
@dorchard
Copy link
Member

TODO: We will split off the generate Python into its own branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants