Skip to content

Build plot_fmri_data_example errors on computers with few possibilities. #395

@antoinebaker

Description

@antoinebaker

When building the doc:

    Unexpected failing examples (1):
    
        ../../examples/plot_fmri_data_example.py failed leaving traceback:
    
        Traceback (most recent call last):
          File "/Users/abaker/Documents/hidimstat/examples/plot_fmri_data_example.py", line 71, in <module>
            resource.setrlimit(resource.RLIMIT_AS, (int(5 * 1e9), int(5 * 1e9)))
            ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ValueError: current limit exceeds maximum limit

According to copilot, a possible fix is to ensure the limit does not exceed the system's maximum:

import resource

soft, hard = resource.getrlimit(resource.RLIMIT_AS)
new_limit = int(5 * 1e9)
resource.setrlimit(resource.RLIMIT_AS, (min(new_limit, hard), hard))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions