Skip to content

feat: adding .xml extension to models #9

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Azzedde
Copy link

@Azzedde Azzedde commented May 17, 2025

Summary

This PR ensures SBML model files are saved with .xml extension to clearly indicate their format and improve file type recognition.

Changes

  • Modified _makeModelSource() in model.py to automatically add .xml extension for SBML model files (types: SBML_FILE, SBML_STR, SBML_URL)
  • Maintained backward compatibility with existing model references
  • Updated docstring to clearly document the new behavior

Motivation

Closes #6 - Model files should have the extension "xml". This change:

  • Makes file types immediately recognizable
  • Follows standard conventions for SBML/XML files
  • Improves compatibility with tools that expect XML extensions

How to test

  1. Create SBML models using different reference types (file, string, URL)
  2. Verify saved files have .xml extension
  3. Check that existing model loading still works
  4. Test with both new and existing model files

Risks & considerations

  • Any code that assumes model files don't have extensions may need updates
  • The change only affects SBML files - Antimony files still use no extension
  • Existing model files without extensions will still work due to backward compatibility

Additional information

The implementation preserves all existing functionality while adding the extension for better file type identification. The change is minimal and focused only on the file saving logic.

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.

Model files should have the extension "xml"
1 participant