Skip to content

Commit

Permalink
Merge pull request #10 from febrifahmi/dev
Browse files Browse the repository at this point in the history
update: adding some test and updating README.md
  • Loading branch information
febrifahmi authored Feb 13, 2023
2 parents 5e7a84c + 14c17cb commit e6f2a88
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 8 deletions.
Binary file modified .coverage
Binary file not shown.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# geotekppu
# GeotekPPU (geotekppu)
![Coverage](coverage.svg "Test Coverage")
A python module for geotechnic analysis

A python module for geotechnic analysis.

## Usage

### Rock Mass Rating (RMR89)

Rock Mass Rating (RMR) is a rating system proposed by Bieniawski (1989) to classify rock based on five classification parameters.

```
Parameters:
-----------
r1 : strength rating
r2 : Rock Quality Designation (RQD) rating
r3 : space of discontinuity rating
r4 : condition of discontinuity rating
r5 : ground water rating
Return(s):
----------
RMR89 / rock mass rating value which consists of:
- Rating value
- Class number (I, II, III, IV, V)
- Description (Very good rock, Good rock, Fair rock, Poor rock, Very poor rock)
```

References:
-----------
Code developed base on [1]__
.. [1] Bieniawski, Z.T. 1989. Engineering rock mass classifications. New York: Wiley.

9 changes: 3 additions & 6 deletions geotekppu/rmr/rmr__bieniawski1989.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (2023) Febri Fahmi Hakim ([email protected]) and Daru Jaka Sasangka
Copyright (2023) Febri Fahmi Hakim ([email protected]) and Daru Jaka Sasangka ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand Down Expand Up @@ -155,7 +155,7 @@ def r5(inflow, wpress, cond):
inflow - inflow per 10 m tunnel length (i/m)
wpress - joint water pressure / major principal
cond - general conditions
cond - general conditions (dry, damp, wet, dripping, or flowing)
Return:
-------
Expand Down Expand Up @@ -183,9 +183,6 @@ def rmr89(r1, r2, r3, r4, r5):
An implementation of [1]__.
Features:
---------
Parameters:
-----------
Expand All @@ -201,7 +198,7 @@ def rmr89(r1, r2, r3, r4, r5):
RMR89 / rock mass rating value which consists of:
- Rating value
- Class number (I, II, III, IV, V)
- Description (Very good rock, good rock, Fair rock, Poor rock, Very poor rock)
- Description (Very good rock, Good rock, Fair rock, Poor rock, Very poor rock)
Notes:
------
Expand Down
44 changes: 44 additions & 0 deletions test/test_rmr89.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,50 @@ def test_r1_9(self):

def test_r1_10(self):
self.assertNotEqual(r1("pls", 0), "Please choose ucs")

def test_r1_11(self):
self.assertEqual(r1("ucs", 251), 15)

def test_r1_12(self):
self.assertEqual(r1("ucs", 165), 12)

def test_r1_13(self):
self.assertEqual(r1("ucs", 67), 7)

def test_r1_14(self):
self.assertEqual(r1("ucs", 33), 4)

def test_r1_15(self):
self.assertEqual(r1("ucs", 19), 2)

def test_r1_16(self):
self.assertEqual(r1("ucs", 3), 1)

def test_r1_17(self):
self.assertEqual(r1("ucs", 0.73), 0)

def test_r1_18(self):
self.assertNotEqual(r1("ucs", 251), 7)

def test_r1_19(self):
self.assertNotEqual(r1("ucs", 165), 15)

def test_r1_20(self):
self.assertNotEqual(r1("ucs", 67), 12)

def test_r1_21(self):
self.assertNotEqual(r1("ucs", 33), 2)

def test_r1_22(self):
self.assertNotEqual(r1("ucs", 19), 1)

def test_r1_23(self):
self.assertNotEqual(r1("ucs", 3), 4)

def test_r1_24(self):
self.assertNotEqual(r1("ucs", 0.73), 14)



if __name__ == '__main__':
unittest.main()

0 comments on commit e6f2a88

Please sign in to comment.