Skip to content

Commit

Permalink
Merge pull request #67 from WEgeophysics/develop
Browse files Browse the repository at this point in the history
Add exception for Tipper data
  • Loading branch information
earthai-tech committed Jul 3, 2023
2 parents 9830677 + fdccb9c commit 40dbe08
Show file tree
Hide file tree
Showing 36 changed files with 782 additions and 703 deletions.
47 changes: 9 additions & 38 deletions pycsamt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import subprocess
import logging
import os
import tempfile


# setup the package
if __package__ is None or __name__ == '__main__':
Expand All @@ -48,16 +48,15 @@
__package__= 'pycsamt'

# configure the logger
from pycsamt.utils._csamtpylog import csamtpylog
try:
csamtpylog.load_configure(os.path.join(
os.path.abspath('.'),'pycsamt', 'utils', "p.configlog.yml"))
except:
csamtpylog.load_configure(os.path.join(
os.path.abspath('.'),'utils', "p.configlog.yml"))
from pycsamt._csamtpylog import csamtpylog


conffile = os.path.join(
os.path.dirname(__file__), "p.configlog.yml")
csamtpylog.load_configure(conffile)

# set loging Level
logging.getLogger('matplotlib').setLevel(logging.WARNING)
logging.getLogger('matplotlib.font_manager').setLevel(logging.WARNING)

epsg_dict = {
28350: ['+proj=utm +zone=50 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs', 50],
Expand Down Expand Up @@ -199,37 +198,9 @@ def is_installing (
else :
imtpy =True

# set path for demo and testing module
# Get the repository dir like https://github.com/WEgeophysics/pycsamt /
#C:github.com/WEgeophysics/pyCSAMT
PYCSAMT_ROOT = os.path.normpath(
os.path.abspath(
os.path.dirname(
os.path.dirname(__file__)
)
)
)

EDI_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/edi'))
AVG_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/avg'))
J_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/j'))
DRILL_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/drill_examples_files'))
OCCAM2D_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/occam2d'))
STN_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/stn_profiles'))
CONFIG_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/_conffiles'))

SYSTEM_TEMP_DIR = tempfile.gettempdir()
NEW_TEMP_DIR=tempfile.mkdtemp(prefix="pycsamt_tmpdir_")



__all__=['tqdm', 'mtpy', 'numba', 'is_installing']



Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions pycsamt/_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 10 18:49:02 2022
@author: daniel
"""
import os
import tempfile
# set path for demo and testing module
# Get the repository dir like https://github.com/WEgeophysics/pycsamt /
#C:github.com/WEgeophysics/pyCSAMT
PYCSAMT_ROOT = os.path.normpath(
os.path.abspath(
os.path.dirname(
os.path.dirname(__file__)
)
)
)

EDI_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/edi'))
AVG_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/avg'))
J_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/j'))
DRILL_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/drill_examples_files'))
OCCAM2D_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/occam2d'))
STN_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/stn_profiles'))
CONFIG_DATA_DIR = os.path.normpath(
os.path.join(PYCSAMT_ROOT , 'data/_conffiles'))

SYSTEM_TEMP_DIR = tempfile.gettempdir()
NEW_TEMP_DIR=tempfile.mkdtemp(prefix="pycsamt_tmpdir_")

2 changes: 1 addition & 1 deletion pycsamt/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)

import pycsamt.utils.func_utils as FU
from pycsamt.utils._csamtpylog import csamtpylog
from pycsamt._csamtpylog import csamtpylog


T=TypeVar('T')
Expand Down
Loading

0 comments on commit 40dbe08

Please sign in to comment.