Skip to content

Latest commit

 

History

History

scripts

###########################################################################
#
# SWIG-generated python wrapper for the Linear Arrangement Library
# Copyright (C) 2021 - 2023 Lluís Alemany Puig
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Contact:
#
#     Lluís Alemany Puig (lluis.alemany.puig@upc.edu)
#         LQMC (Quantitative, Mathematical, and Computational Linguisitcs)
#         CQL (Complexity and Quantitative Linguistics Lab)
#         Jordi Girona St 1-3, Campus Nord UPC, 08034 Barcelona.   CATALONIA, SPAIN
#         Webpage: https://cqllab.upc.edu/people/lalemany/
#
###########################################################################

DESCRIPTION OF EACH SCRIPT
==========================

LAL_DIR=/home/lluis/Documents/projects/linear-arrangement-library
LAL_DIR_PYINT=$LAL_DIR/python-interface

clean_up_documentationi.sh:
	Performs a clean-up of the file $LAL_DIR_PYINT/modules/documentation.i.
	- Detects whether there are expressions with superfluous spaces in mathematical expressions. If there are any, issues an error message for each expresions and exits with code 1.
	- Format title 'Parameters' in the docstrings of overloaded functions so that it looks like a section heading as much as possible.
	- Replaces matching math delimiters '$$' with ':math:` and '`'.
	- Removes return types from functions (recall, however, these are not in the function's definition).
	
	Called by:
		'$LAL_DIR/make_docs.sh python'
	Calls:
		python3 scripts/detect_superfluous_spaces_math.py modules/documentation.i
		python3 scripts/correct_math_delimiters.py modules/documentation.i

clean_up_interfaces.sh:
	- Removes return types from function definitions
	- Removes parameter types from function definitions:
		from
			def f(a: "int", b: "Bool"=True, c: "std::string", d: "std::vector< uint32_t >")
		to
			def f(a, b=True, c, d)
	
	Called by:
		'$LAL_DIR_PYINT/postprocess_interface_file.sh $1' (where $1 is a filename passed as parameter)
	Calls:
		None

correct_math_delimiters.py:
	- Replaces matching math delimiters '$$' with ':math:` and '`'.
	
	Called by:
		clean_up_documentationi.sh
	Calls:
		None

detect_superfluous_spaces_math.py:
	This script detects whether there are expressions with superfluous spaces in mathematical expressions. If there are any, issues an error message for each expresions and exits with code 1.
	
	Called by:
		clean_up_documentationi.sh
	Calls:
		None

postprocess_interface_file.sh:
	Postprocess an interface file (a .py file generated by SWIG).
	
	Called by:
		$LAL_DIR_PYINT/Makefile
	Calls:
		$LAL_DIR_PYINT/scripts/clean_up_interfaces.sh $1
		$LAL_DIR_PYINT/scripts/prepend_module_docs.sh $1
		
		(where '$1' is the name of the interface file passed as parameter by the Makefile)

prepend_module_docs.sh:
	Prepends the documentation of the module corresponding to the python interface file (generated by SWIG) passed as parameter.
	
	Called by:
		postprocess_interface_file.sh
	Calls:
		None