Skip to content

Latest commit

 

History

History
125 lines (85 loc) · 3.98 KB

File metadata and controls

125 lines (85 loc) · 3.98 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning since version 1.1.0.

[Unreleased] - 2025-07-01

Added

Changed

Removed

Fixed

[1.2.0] - 2025-07-01

This release introduces a new decorator, output_names, designed for use with user-defined connector and selector functions. If you've ever encountered an OSError: could not get source code using either create_edges or create_edges_ft, this release addresses that issue. The output_names decorator allows you to explicitly define the names of the output variables returned by these functions, avoiding the need to read source code.

Added

  • deepgraph.output_names decorator: A new decorator to explicitly define the output variable names of connector or selector functions. This is necessary when the source code of the function is not available at runtime. The decorator attaches the specified output names to the decorated function via the _output_names attribute.

    Example:

    import deepgraph as dg
    
    @dg.output_names("dx", "dt", "v")
    def velocity(x_s, x_t, time_s, time_t):
        dx = x_t - x_s
        dt = time_t - time_s
        v = dx/dt
        return dx, dt, v

Fixed

  • Fixed OSError: could not get source code by introducing the output_names decorator for explicitly defining output variable names in user-defined functions.

[1.1.0] - 2025-06-22

This release adds support for new, valid return formats of user-defined connector/selector functions (see create_edges). Specifically, explicit tuples and multi-line return statements are now possible. This enhancement increases flexibility and improves input validation.

The public API remains unchanged.

Added

  • Introduced a robust AST-based implementation for extracting output variables from user-defined functions.
    • This improves reliability and parsing accuracy across supported Python versions (3.9+).

    • The extraction now strictly enforces that return statements contain only variable names.

    • It is now also possible to return output variables as:

      Example: explicit tuple

      def velocity(dt, x_s, x_t):
          dx = x_t - x_s
          v = dx / dt
          return (v, dx)

      Example: multi-line tuple

      def velocity(dt, x_s, x_t):
          dx = x_t - x_s
          v = dx / dt
          return (
              v,
              dx
          )
  • Added CHANGELOG.md file.

Changed

  • Replaced previous string-based return parsing using inspect.getsourcelines() with a more accurate approach using inspect.getsource() and the ast module.
  • Output validation errors will now be raised if the return statement contains expressions, function calls, or anything other than variable names.
  • Updated input argument parsing logic to use inspect.signature() instead of inspect.getfullargspec(), improving forward compatibility.

Removed

  • The conda recipe to build a conda package locally. Conda packages are build by conda-forge using this recipe.

Fixed

  • Resolved "UnclosedFileWarning: Closing remaining open file" warnings in tests involving hdf tables.
  • Homogenized license information across project files
  • pyproject.toml had wrong license information (BSD-2-Clause), changed it to the correct one (BSD-3-Clause).