Migrating from commercial platforms to open source
Research code locked to a commercial platform has a structural
problem: every user, collaborator, student, reviewer and CI runner
needs a license, and reproducibility acquires an expiry date tied to
a vendor. Migration to open alternatives removes the toll booth and
makes the work FAIR in practice (rseng-fair-software) - but a naive
"translate the syntax" migration produces subtly wrong science. The
discipline: pin behavior first, choose the target honestly, migrate
incrementally with numerical parity as the acceptance test. The
general safety net (characterization tests, strangler migration)
lives in rseng-legacy-code; this skill adds the platform-specific
knowledge.
Before migrating: pin the baseline
While the commercial license still works, capture everything the
migration must reproduce (this window may not stay open):
- Run the original on representative inputs and save inputs and
outputs as the golden baseline (rseng-legacy-code's
characterization tests).
- Record the platform version, toolbox versions and settings that
produced the baseline.
- Export data OUT of proprietary formats now: .mat to HDF5-based or
open formats, SAS/SPSS/Stata files to open tabular formats
(rseng-scientific-file-formats) - data freedom precedes code
freedom, and readers for proprietary formats are better used
while a licensed installation can verify the export.
Choosing the target
- MATLAB, two honest paths: GNU Octave runs most plain MATLAB with
minimal changes - the low-cost exit when the goal is simply
license freedom; Python/NumPy/SciPy is the larger move that buys
ecosystem, packaging (rseng-project-scaffolding) and hiring, at the
cost of a real port. Choose Octave for frozen-but-must-run code,
Python for code with a future. (Simulink has no clean open
equivalent - flag it as the hard part early.)
- IDL: Python is the community-standard destination (astronomy's
stack - astropy and friends - exists precisely from this
migration).
- SAS/SPSS/Stata: R (statistical depth, native model objects) or
pandas/statsmodels; verify statistical defaults match - the same
named procedure can use different degrees-of-freedom or contrast
conventions, which is a science difference, not a bug.
- Mathematica: SymPy for symbolic work, Julia for symbolic-numeric
blends.
- LabVIEW and instrument control: Python instrument stacks are the
destination, but hardware interfaces make this a re-engineering
project, not a translation.
- Whatever the target, check whether the field already has an open
reimplementation of the domain workflow before porting line by
line (rseng-software-reuse) - many "migrations" should be
adoptions.
Translation pitfalls (where silent wrongness lives)
The famous ones an agent must actively check, not discover:
- Indexing: MATLAB/Octave/R/Julia are 1-based, column-major;
NumPy is 0-based, row-major. Every hand-translated index and
every reshape/flatten is a suspect until tested.
- Copy semantics: MATLAB copies on assignment; NumPy slices are
VIEWS - in-place modification after translation corrupts data
that MATLAB code safely mutated.
- Broadcasting and implicit expansion rules differ in edges;
element-wise vs matrix operators (.* vs *) invert their
defaultness between MATLAB and NumPy.
- Toolbox calls map to ecosystems, not functions: Signal Processing
Toolbox to scipy.signal, Statistics Toolbox to statsmodels/scipy.
stats, Image Processing to scikit-image - map the WORKFLOW to the
library's idiom instead of reimplementing the MATLAB function
signature.
- Numerical defaults: solvers, tolerances, RNG algorithms and seeds
differ across platforms; identical seeds do NOT give identical
streams, so statistical results match in distribution, not
bitwise (rseng-numerical-accuracy sets the tolerance discipline,
rseng-reproducibility the seed bookkeeping).
- Automatic translators (MATLAB-to-Python converters and similar)
produce a starting draft at best: un-idiomatic, license-check the
output, and every translated function still needs its parity
test. Interop bridges (oct2py running Octave from Python) are
better used as migration scaffolding - call the old
implementation module by module while the new one grows - than as
a destination.
Migration as a project
- Inventory and rank: which scripts/functions matter, which are
dead; migrate the load-bearing path first.
- Module-by-module with parity gates: port a module, run both
implementations against the baseline inputs, assert agreement
within scientifically justified tolerances, only then delete or
bypass the original (strangler pattern - rseng-legacy-code).
- Adopt the target's ecosystem hygiene as you go: environments and
lockfiles (rseng-reproducible-environments), tests
(rseng-testing), CI without license servers - the ability to run
tests on every commit is a migration dividend
(rseng-ci-cd).
- Keep a translation log: mapping decisions, tolerance
justifications, known behavior differences - the scientific
record of the migration (rseng-documentation), and cite the
original code's authors (rseng-citation-metadata).
- Announce the migration to users with a compatibility note
(rseng-science-communication) and license the freed code properly
(rseng-licensing) - opening the platform without opening the
license wastes the trip.
Working with this skill
This skill is source-independent: it encodes community migration
practice between scientific computing platforms. The generic
legacy-code safety net is rseng-legacy-code; this skill is its
commercial-platform specialization.
Learn more (verified):
Related skills
Check whether any of these applies before moving on:
- rseng-legacy-code - characterization tests and strangler pattern
- rseng-licensing - license the freed code
- rseng-numerical-accuracy - parity tolerances across platforms
- rseng-reproducible-environments - target-ecosystem pinning as you go
- rseng-scientific-file-formats - exporting proprietary data formats first
- rseng-software-reuse - adopt an existing open reimplementation
1---2name: rseng-open-source-migration3description: Covers migrating research code from commercial, license-bound platforms to open source alternatives: MATLAB to Octave or Python/NumPy, IDL to Python, SAS/SPSS/Stata to R or pandas, Mathematica to SymPy/Julia, and the platform-specific pitfalls (indexing, copy semantics, toolbox equivalents, numerical parity). Use when the user wants to leave MATLAB, IDL, SAS, SPSS, Stata, Mathematica, LabVIEW or another proprietary platform, asks for an open or free alternative to commercial scientific software, can no longer afford or access a license, or needs collaborators without licenses to run the code. (The characterization-test safety net and general inherited-code discipline are rseng-legacy-code.)4license: CC-BY-4.05---67# Migrating from commercial platforms to open source89Research code locked to a commercial platform has a structural10problem: every user, collaborator, student, reviewer and CI runner11needs a license, and reproducibility acquires an expiry date tied to12a vendor. Migration to open alternatives removes the toll booth and13makes the work FAIR in practice (rseng-fair-software) - but a naive14"translate the syntax" migration produces subtly wrong science. The15discipline: pin behavior first, choose the target honestly, migrate16incrementally with numerical parity as the acceptance test. The17general safety net (characterization tests, strangler migration)18lives in rseng-legacy-code; this skill adds the platform-specific19knowledge.2021## Before migrating: pin the baseline2223While the commercial license still works, capture everything the24migration must reproduce (this window may not stay open):2526- Run the original on representative inputs and save inputs and27 outputs as the golden baseline (rseng-legacy-code's28 characterization tests).29- Record the platform version, toolbox versions and settings that30 produced the baseline.31- Export data OUT of proprietary formats now: .mat to HDF5-based or32 open formats, SAS/SPSS/Stata files to open tabular formats33 (rseng-scientific-file-formats) - data freedom precedes code34 freedom, and readers for proprietary formats are better used35 while a licensed installation can verify the export.3637## Choosing the target3839- MATLAB, two honest paths: GNU Octave runs most plain MATLAB with40 minimal changes - the low-cost exit when the goal is simply41 license freedom; Python/NumPy/SciPy is the larger move that buys42 ecosystem, packaging (rseng-project-scaffolding) and hiring, at the43 cost of a real port. Choose Octave for frozen-but-must-run code,44 Python for code with a future. (Simulink has no clean open45 equivalent - flag it as the hard part early.)46- IDL: Python is the community-standard destination (astronomy's47 stack - astropy and friends - exists precisely from this48 migration).49- SAS/SPSS/Stata: R (statistical depth, native model objects) or50 pandas/statsmodels; verify statistical defaults match - the same51 named procedure can use different degrees-of-freedom or contrast52 conventions, which is a science difference, not a bug.53- Mathematica: SymPy for symbolic work, Julia for symbolic-numeric54 blends.55- LabVIEW and instrument control: Python instrument stacks are the56 destination, but hardware interfaces make this a re-engineering57 project, not a translation.58- Whatever the target, check whether the field already has an open59 reimplementation of the domain workflow before porting line by60 line (rseng-software-reuse) - many "migrations" should be61 adoptions.6263## Translation pitfalls (where silent wrongness lives)6465The famous ones an agent must actively check, not discover:6667- Indexing: MATLAB/Octave/R/Julia are 1-based, column-major;68 NumPy is 0-based, row-major. Every hand-translated index and69 every reshape/flatten is a suspect until tested.70- Copy semantics: MATLAB copies on assignment; NumPy slices are71 VIEWS - in-place modification after translation corrupts data72 that MATLAB code safely mutated.73- Broadcasting and implicit expansion rules differ in edges;74 element-wise vs matrix operators (.* vs *) invert their75 defaultness between MATLAB and NumPy.76- Toolbox calls map to ecosystems, not functions: Signal Processing77 Toolbox to scipy.signal, Statistics Toolbox to statsmodels/scipy.78 stats, Image Processing to scikit-image - map the WORKFLOW to the79 library's idiom instead of reimplementing the MATLAB function80 signature.81- Numerical defaults: solvers, tolerances, RNG algorithms and seeds82 differ across platforms; identical seeds do NOT give identical83 streams, so statistical results match in distribution, not84 bitwise (rseng-numerical-accuracy sets the tolerance discipline,85 rseng-reproducibility the seed bookkeeping).86- Automatic translators (MATLAB-to-Python converters and similar)87 produce a starting draft at best: un-idiomatic, license-check the88 output, and every translated function still needs its parity89 test. Interop bridges (oct2py running Octave from Python) are90 better used as migration scaffolding - call the old91 implementation module by module while the new one grows - than as92 a destination.9394## Migration as a project95961. Inventory and rank: which scripts/functions matter, which are97 dead; migrate the load-bearing path first.982. Module-by-module with parity gates: port a module, run both99 implementations against the baseline inputs, assert agreement100 within scientifically justified tolerances, only then delete or101 bypass the original (strangler pattern - rseng-legacy-code).1023. Adopt the target's ecosystem hygiene as you go: environments and103 lockfiles (rseng-reproducible-environments), tests104 (rseng-testing), CI without license servers - the ability to run105 tests on every commit is a migration dividend106 (rseng-ci-cd).1074. Keep a translation log: mapping decisions, tolerance108 justifications, known behavior differences - the scientific109 record of the migration (rseng-documentation), and cite the110 original code's authors (rseng-citation-metadata).1115. Announce the migration to users with a compatibility note112 (rseng-science-communication) and license the freed code properly113 (rseng-licensing) - opening the platform without opening the114 license wastes the trip.115116## Working with this skill117118This skill is source-independent: it encodes community migration119practice between scientific computing platforms. The generic120legacy-code safety net is rseng-legacy-code; this skill is its121commercial-platform specialization.122123Learn more (verified):124 - https://octave.org - GNU Octave125 - https://numpy.org/doc/stable/user/numpy-for-matlab-users.html -126 NumPy for MATLAB users (official mapping guide)127 - https://scipy.org - SciPy ecosystem128 - https://github.com/blink1073/oct2py - oct2py Octave-Python129 bridge130 - https://www.sympy.org - SymPy symbolic mathematics131 - https://julialang.org - Julia132 - https://pandas.pydata.org - pandas133 - https://docs.astropy.org/en/stable/ - Astropy (the IDL-exodus134 ecosystem)135136<!-- related-skills:begin -->137138## Related skills139140Check whether any of these applies before moving on:141142- rseng-legacy-code - characterization tests and strangler pattern143- rseng-licensing - license the freed code144- rseng-numerical-accuracy - parity tolerances across platforms145- rseng-reproducible-environments - target-ecosystem pinning as you go146- rseng-scientific-file-formats - exporting proprietary data formats first147- rseng-software-reuse - adopt an existing open reimplementation148149<!-- related-skills:end -->