Skip to content

Commit

Permalink
shared_memory issue resolved for python3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
SrikanthKom committed Jan 19, 2023
1 parent a28fa44 commit 5da8fdc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
13 changes: 12 additions & 1 deletion vip_hci/preproc/badpixremoval.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@
from .cosmetics import frame_pad
from multiprocessing import Process
import multiprocessing
from multiprocessing import shared_memory, set_start_method
from multiprocessing import set_start_method
try:
from multiprocessing import shared_memory
except ImportError:
print('Failed to import shared_memory from multiprocessing')
try:
print('Trying to import shared_memory directly(for python 3.7)')
import shared_memory
except ModuleNotFoundError:
print('Use shared_memory on python 3.7 to activate')
print('multiprocessing on badpixels using..')
print('pip install shared-memory38')

import warnings
try:
Expand Down
15 changes: 13 additions & 2 deletions vip_hci/preproc/cosmetics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env python
# check123

"""
Module with cosmetics procedures. Contains the function for bad pixel fixing.
Also functions for cropping cubes.
Expand All @@ -23,7 +23,18 @@
from ..var import frame_center, get_square
from multiprocessing import Process
import multiprocessing
from multiprocessing import shared_memory, set_start_method
from multiprocessing import set_start_method
try:
from multiprocessing import shared_memory
except ImportError:
print('Failed to import shared_memory from multiprocessing')
try:
print('Trying to import shared_memory directly(for python 3.7)')
import shared_memory
except ModuleNotFoundError:
print('Use shared_memory on python 3.7 to activate')
print('multiprocessing on badpixels using..')
print('pip install shared-memory38')


def cube_crop_frames(array, size, xy=None, force=False, verbose=True,
Expand Down

0 comments on commit 5da8fdc

Please sign in to comment.