예제 #1
0
 def setUp(self):
     self.path = get_path(__file__)
예제 #2
0
#     This program is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with this program.  If not, see <https: //www.gnu.org/licenses/>.
"""Performance test for reading a file containing ground models."""

import cProfile
import pstats

import swprepost
from testtools import get_path

path = get_path(__file__)


def main():
    fname = path / "data/gm/test_gm_mod100.txt"
    swprepost.GroundModelSuite.from_geopsy(fname=fname)


fname = path / "data/.tmp_profiler_run"
data = cProfile.run('main()', filename=fname)
stat = pstats.Stats(fname)
stat.sort_stats('tottime')
stat.print_stats(0.1)

# YEAR - MO - DY : TIME UNIT
# -------------------------