Skip to main content

Fortran Parsing, Unit Testing and Intellisense

Project description

FORTPY
======

Python Emacs Intellisense and Unit Testing Support for Fortran
--------------------------------------------------------------

Fortpy is a python based parsing, unit testing and auto-complete
framework for supporting Fortran 2003 including object oriented
constructs. Auto-completion integration currently only available for
emacs. Here are some of the features:

Python Package Installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fortpy requires the following python packages: -
`python-epc <https://github.com/tkf/python-epc>`__ - argparse -
`paramiko <https://github.com/paramiko/paramiko>`__ if you will be
editing over SSH using tramp in emacs and still want auto-complete
support. - pyparsing - dateutil

If you install Fortpy using ``pip install`` the dependencies will
automatically get installed.

::

pip install fortpy

Fortpy Configuration
~~~~~~~~~~~~~~~~~~~~

In most real-usage scenarios, the out-of-the-box support for multiple
libraries is incomplete. A `configuration
file <https://github.com/rosenbrockc/fortpy/wiki/Fortpy-Global-Configuration>`__
can be created that gives additional information about source code
folders to parse, server information for SSH editing over tramp and
auto-completion configuration settings. After you have created a
``config.xml`` file on your system, you need to configure an environment
variable to tell Fortpy where to find it:

``export FORTPY_CONFIG="~/path/to/config.xml"``

NOTE: Environment variables for emacs are set when it first starts;
adding a config.xml file will not affect the emacs isense support until
you restart emacs.

Screenshots
-----------

Here are some of the things you can do once Fortpy is integrated with
Emacs using fortpy.el:

.. figure:: ../master/docs/screenshots/signature.png
:alt: Help with call signatures of functions and subroutines.

Automatic Signature Suggestions
Help with call signatures of functions and subroutines.

.. figure:: ../master/docs/screenshots/completion.png
:alt: Completion suggestions for both methods and variables embedded in user-defined types.

Embedded Member Suggestions
Completion suggestions for both methods and variables embedded in
user-defined types.

.. figure:: ../master/docs/screenshots/bracket_complete.png
:alt: Documentation strings for methods embedded in user-defined types

Bracket Complete Embedded Methods
Documentation strings for methods embedded in user-defined types.

Features
--------

Auto-complete Support
~~~~~~~~~~~~~~~~~~~~~

- Integration with emacs using virtualenv, epc and auto-complete.
- Context-specific suggestions for variable names and available
executables.

See the `isense package
documentation <https://github.com/rosenbrockc/fortpy/wiki/Intellisense-Package>`__

XML Documentation Standard
~~~~~~~~~~~~~~~~~~~~~~~~~~

Fortpy uses an `XML documentation
standard <https://github.com/rosenbrockc/fortpy/wiki/XML-Documentation-Standard>`__
that is derived from the Microsoft XML code documentation standard. As
such, many of the same tags and attributes are available for decorating
the methods, types and variables in a Fortran module. Because the
parsers were designed to work with Fortran 2003, they understand
embedded methods in user types that point to other methods in the
module. See the wiki page on documenting your code to work with Fortpy.

.. figure:: ../master/docs/screenshots/xml_docs.png
:alt: XML documentation standard allows for complex documentation strings and structures.

XML Documentation Example
Automated Unit Testing
~~~~~~~~~~~~~~~~~~~~~~

Because Fortpy is aware of the structure and dependencies between
modules, it can generate automated unit tests for individual functions.
You can specify the tests to run in some XML documentation decorating
the method to test. When the unit testing scripts are run, a fortran
program gets generated and all the necessary dependencies are
automatically included. After running the program, the framework tests
the output and generates a similarity score. `See the full
documentation <https://github.com/rosenbrockc/fortpy/wiki/Unit-Testing-Package>`__.

Code Version Support
~~~~~~~~~~~~~~~~~~~~

Fortpy's unit testing framework makes use of XML templates that specify
the structure of input/output files to run and test. Using these same
templates, the interoperability package allows input and ouput files to
be converted between versions of the Fortran program. Since most Fortran
programs run on simple text files for input, the interop package also
gives support for XML input files to be used; scripts convert the XML
input files to the correct plain-text format at run-time.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Fortpy-1.1.4.tar.gz (400.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Fortpy-1.1.4-py2.py3-none-any.whl (194.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Fortpy-1.1.4.tar.gz.

File metadata

  • Download URL: Fortpy-1.1.4.tar.gz
  • Upload date:
  • Size: 400.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Fortpy-1.1.4.tar.gz
Algorithm Hash digest
SHA256 0bd8a301c07812c1cf8cf93d0e7ca140fc56b4aed85e9bdc3bb0bdb7f529c981
MD5 8f66b6d5d58ada51c4b14fd7f1cbd24d
BLAKE2b-256 356385daa2faae647e06b72faa3fa78fe2d07d4d1b93245545d7a8bb79c1983f

See more details on using hashes here.

File details

Details for the file Fortpy-1.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Fortpy-1.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f26d23f21c95476342f67ebaa2d5b135ea6952c2a8db163f0d67da1366ae0eb4
MD5 8741c729f2d3a2cf247fc8e8fa4aaeda
BLAKE2b-256 e4d37913de1ec79f9463525aec49650c66d6614fe35e0434e8222223a88897ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page