TransInfo support for new directory/file structure of transformations

Open
#620 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

Start by reading the current TransInfo implementation and issue #474, then compare the transformation locations named here: domain/API/transformations and psyir/transformations. Decide which of the four proposed approaches is required, and define completion through documented behavior and tests for querying available transformations.

Written by the indexing model from the issue text.

Description

enhancement question

Atm TransInfo reads one file to get all information about all available transformations. When implementing #474 all transforms will sit in a separate file, and even in different directories (domain/API/transformations, psyir/transformations).

It can be quite expensive to import files in python (since it goes through its search path), so it seems somewhat inefficient to create an instance of TransInfo which needs to parse all transformations, and then the user will query for one or two transforms only.

TBH, I have never used TransInfo, I always found it easier to just import the transform I need directly (though of course it means that I now need to change my scripts when the transformations are in a new location).

How should we handle this in the future?

  1. Remove TransInfo, and let user directly import the transformation?
  2. Change the way TransInfo works: the user queries for say 'ExtractTrans'. TransInfo then takes the API (from the config), checks if domain/API/transformation/APINAME+"extract_trans" can be imported, if not checks for psyir/transformation/+"extract_trans". The file name obviously must be deduced from the camel-case name (replace upper case letters except first with ""+lowercase letter)
  3. Keep on parsing all files?
  4. Something else?
Dominant language
Python
Stars
137
Forks
36
Avg merge
6d 16h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stfc/PSyclone

All issues in stfc/PSyclone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.