Skip to content

Conversation

@Alxiice
Copy link
Contributor

@Alxiice Alxiice commented Aug 21, 2025

Warning

It would be better to merge this PR after #2845 because the logger is not available in process for now (as it's provided by chunk). This PR mentioned fixes this by setuping logging so that we can use it directly

Description

  • Add a process function
  • If there is no parallelization, then if processChunk has not been overrided, then process will be called

Examples

Because we don't have access to the chunk we can't use chunk.logger

import logging
logger = logging.getLogger("TestNode2")

def print_info():
    logger.info(f"Message with info    level ({logger})")
    logger.warning(f"Message with warning level ({logger})")
    logger.error(f"Message with error   level ({logger})")

class TestNode3(desc.Node):    
    inputs = [
        desc.ChoiceParam(
            name='verboseLevel',
            label='Verbose Level',
            description='''verbosity level (fatal, error, warning, info, debug, trace).''',
            value='info',
            values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
            exclusive=True,
        ),
    ]

    outputs = [
        desc.File(
            name='outputFolder',
            label='outputFolder',
            description='outputFolder',
            value="{nodeCacheFolder}",
        ),
    ]

    def process(self, node):
        logger.setLevel(node.verboseLevel.value.upper())
        logger.info(f"> verboseLevel : {node.verboseLevel.value}")
        logger.info(f"> outputFolder : {node.outputFolder.value}")
        print_info()
image

However, after #2845 this won't be an issue because we could use logging normally :
image

@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.08%. Comparing base (123c15a) to head (1be1fc5).
⚠️ Report is 3 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/desc/node.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2847      +/-   ##
===========================================
+ Coverage    79.00%   79.08%   +0.07%     
===========================================
  Files           51       51              
  Lines         6858     6889      +31     
===========================================
+ Hits          5418     5448      +30     
- Misses        1440     1441       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Alxiice Alxiice changed the title [desc] Add process function on node desc so that we can skip the chun… [desc] Add node process function to use on single-chunk nodes Aug 21, 2025
@Alxiice Alxiice force-pushed the dev/add_node_process_on_desc branch from 8d939a7 to 9c4f6b2 Compare August 25, 2025 08:50
@cbentejac cbentejac added this to the Meshroom 2026.1.0 milestone Sep 2, 2025


class TestNodeA(desc.BaseNode):
__test__ = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: without the __test__ = False line, pytest tries to load the TestNodeA and TestNodeB classes because of the "Test" in their name, and fails as they have __init__ methods.

An alternative to using __test__ = False would be to rename the classes to not use the word "Test".

Copy link
Contributor

@cbentejac cbentejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but waiting for #2845 to be merged first.

@Alxiice Alxiice force-pushed the dev/add_node_process_on_desc branch 3 times, most recently from 7080dde to 7e56aa0 Compare September 11, 2025 09:32
@Alxiice Alxiice force-pushed the dev/add_node_process_on_desc branch from 7e56aa0 to 4603513 Compare September 12, 2025 16:17
@Alxiice Alxiice force-pushed the dev/add_node_process_on_desc branch from 4603513 to 1be1fc5 Compare September 16, 2025 10:08
@Alxiice Alxiice merged commit c2f3115 into develop Sep 16, 2025
5 checks passed
@Alxiice Alxiice deleted the dev/add_node_process_on_desc branch September 16, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants