Skip to content
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

Process user-specific information into different forms #33

Open
wildlarva opened this issue May 31, 2020 · 0 comments
Open

Process user-specific information into different forms #33

wildlarva opened this issue May 31, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@wildlarva
Copy link
Owner

wildlarva commented May 31, 2020

Is your feature request related to a problem? Please describe.
Some users need to define user-specific information for generating a decoder and process it into different forms before generation. Currently, the mcdecoder cannot process user-specific information before generation,

Describe the solution you'd like
Add a functionality to import user code to process user-specific information into a different form.

Possible implementations for this are:

  • Define a python hook function to process user-specific information and refer it from MC description
    • python config file
      from mcdecoder.core import InstructionDecoder
      
      def process_instruction(instruction: InstructionDecoder) -> None:
        instruction.extras = ...
    • MC description
      decoder:
        process_instruction_hook: process_instruction
  • Define a python hook function to process user-specific information and register to mcdecoder
    • python config file
      from mcdecoder.core import InstructionDecoder, Environment
      
      # define a hook function
      def process_instruction(instruction: InstructionDecoder) -> None:
        instruction.extras = ...
      
      # register a hook function to the environment
      Environment.add_process_instruction_hook(process_instruction)

Describe alternatives you've considered
N/A

Additional context
N/A

@wildlarva wildlarva added the enhancement New feature or request label May 31, 2020
@wildlarva wildlarva changed the title Add user-specific information to decoder model Process user-specific information into different forms May 31, 2020
@wildlarva wildlarva self-assigned this May 31, 2020
wildlarva added a commit that referenced this issue Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant