Skip to content

Commit 14ef9d5

Browse files
authored
Merge pull request #223 from jvdp1/ch_struct
Changes directory structure of stdlib as discussed in #216
2 parents 0d06b13 + 4754c54 commit 14ef9d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+378
-255
lines changed

WORKFLOW.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ experienced contributors will help it through all 5 steps.
2525
always better than large. It is OK to implement only a few functions of a
2626
new module, and continue work on the others in a later PR. All new
2727
functionality goes into an "experimental" namespace
28-
(`stdlib_experimental_*.f90`). As part of the PR, when submitting a new
28+
(`version: experimental`). As part of the PR, when submitting a new
2929
public facing API, please provide the initial draft of the specification
30-
document as well as the the initial reference implementation of this
30+
document as well as the initial reference implementation of this
3131
specification. The
3232
[specification is a document](https://stdlib.fortran-lang.org/page/specs/index.html)
3333
that describes the API and

doc/specs/index.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ This is and index/directory of the specifications (specs) for each new module/fe
1111

1212
## Experimental Features & Modules
1313

14-
- [error](./stdlib_experimental_error.html) - Catching and handling errors
15-
- [IO](./stdlib_experimental_io.html) - Input/output helper & convenience
16-
- [linalg](./stdlib_experimental_linalg.html) - Linear Algebra
17-
- [optval](./stdlib_experimental_optval.html) - Fallback value for optional arguments
18-
- [quadrature](./stdlib_experimental_quadrature.html) - Numerical integration
19-
- [stats](./stdlib_experimental_stats.html) - Descriptive Statistics
14+
- [error](./stdlib_error.html) - Catching and handling errors
15+
- [IO](./stdlib_io.html) - Input/output helper & convenience
16+
- [linalg](./stdlib_linalg.html) - Linear Algebra
17+
- [optval](./stdlib_optval.html) - Fallback value for optional arguments
18+
- [quadrature](./stdlib_quadrature.html) - Numerical integration
19+
- [stats](./stdlib_stats.html) - Descriptive Statistics
2020

2121
## Missing specs
2222

23-
- [ascii](https://github.com/fortran-lang/stdlib/blob/master/src/stdlib_experimental_ascii.f90)
24-
- [kinds](https://github.com/fortran-lang/stdlib/blob/master/src/stdlib_experimental_kinds.f90)
23+
- [ascii](https://github.com/fortran-lang/stdlib/blob/master/src/stdlib_ascii.f90)
24+
- [kinds](https://github.com/fortran-lang/stdlib/blob/master/src/stdlib_kinds.f90)
2525

2626
## Released/Stable Features & Modules
2727

doc/specs/stdlib_experimental_error.md renamed to doc/specs/stdlib_error.md

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: experimental_error
2+
title: error
33
---
44

55
# Catching and handling errors
@@ -8,6 +8,10 @@ title: experimental_error
88

99
## `check` - Checks the value of a logical condition
1010

11+
### Status
12+
13+
Experimental
14+
1115
### Description
1216

1317
Checks the value of a logical condition.
@@ -43,7 +47,7 @@ If `condition` is `.false`., and:
4347

4448
```fortran
4549
program demo_check1
46-
use stdlib_experimental_error, only: check
50+
use stdlib_error, only: check
4751
implicit none
4852
integer :: a = 1
4953
! If a /= 5, stops the program with exit code 1 and prints 'Check failed.'
@@ -52,7 +56,7 @@ end program demo_check1
5256
```
5357
```fortran
5458
program demo_check2
55-
use stdlib_experimental_error, only: check
59+
use stdlib_error, only: check
5660
implicit none
5761
integer :: a = 1
5862
! If a /= 5, stops the program with exit code 1 and prints 'a == 5 failed.'
@@ -61,7 +65,7 @@ end program demo_check2
6165
```
6266
```fortran
6367
program demo_check3
64-
use stdlib_experimental_error, only: check
68+
use stdlib_error, only: check
6569
implicit none
6670
integer :: a = 1
6771
! If a /= 5, prints 'a == 5 failed.', but doesn't stop the program.
@@ -70,7 +74,7 @@ end program demo_check2
7074
```
7175
```fortran
7276
program demo_check3
73-
use stdlib_experimental_error, only: check
77+
use stdlib_error, only: check
7478
implicit none
7579
integer :: a = 1
7680
! If a /= 5, stops the program with exit code 77 and prints 'a == 5 failed.'
@@ -80,13 +84,17 @@ end program demo_check3
8084

8185
## `error_stop` - aborts the program
8286

87+
### Status
88+
89+
Experimental
90+
8391
### Description
8492

8593
Aborts the program with a message and a nonzero exit code.
8694

8795
### Syntax
8896

89-
`call [[stdlib_experimental_error(module):error_stop(interface)]](msg, code)`
97+
`call [[stdlib_error(module):error_stop(interface)]](msg, code)`
9098

9199
### Arguments
92100

@@ -104,7 +112,7 @@ Without error code:
104112

105113
```fortran
106114
program demo_error_stop1
107-
use stdlib_experimental_error, only: error_stop
115+
use stdlib_error, only: error_stop
108116
implicit none
109117
call error_stop("Invalid argument")
110118
end program demo_error_stop1
@@ -114,7 +122,7 @@ With error code:
114122

115123
```fortran
116124
program demo_error_stop2
117-
use stdlib_experimental_error, only: error_stop
125+
use stdlib_error, only: error_stop
118126
implicit none
119127
call error_stop("Invalid argument", code = 123)
120128
end program demo_error_stop2

doc/specs/stdlib_experimental_io.md renamed to doc/specs/stdlib_io.md

+19-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: experimental_IO
2+
title: IO
33
---
44

55
# IO
@@ -8,12 +8,16 @@ title: experimental_IO
88

99
## `loadtxt` - load a 2D array from a text file
1010

11+
### Status
12+
13+
Experimental
14+
1115
### Description
1216
Loads a rank-2 `array` from a text file.
1317

1418
### Syntax
1519

16-
`call [[stdlib_experimental_io(module):loadtxt(interface)]](filename, array)`
20+
`call [[stdlib_io(module):loadtxt(interface)]](filename, array)`
1721

1822
### Arguments
1923

@@ -29,7 +33,7 @@ Returns an allocated rank-2 `array` with the content of `filename`.
2933

3034
```fortran
3135
program demo_loadtxt
32-
use stdlib_experimental_io, only: loadtxt
36+
use stdlib_io, only: loadtxt
3337
implicit none
3438
real, allocatable :: x(:,:)
3539
call loadtxt('example.dat', x)
@@ -39,13 +43,17 @@ end program demo_loadtxt
3943

4044
## `open` - open a file
4145

46+
### Status
47+
48+
Experimental
49+
4250
### Description
4351

4452
Returns the unit number of a file opened to read, to write, or to read and write. The file might be a text file or a binary file. All files are opened using a streamed access.
4553

4654
### Syntax
4755

48-
`u = [[stdlib_experimental_io(module):open(function)]](filename [, mode] [, iostat])`
56+
`u = [[stdlib_io(module):open(function)]](filename [, mode] [, iostat])`
4957

5058
### Arguments
5159

@@ -80,7 +88,7 @@ The result is a scalar of type `integer`.
8088

8189
```fortran
8290
program demo_open
83-
use stdlib_experimental_io, only: open
91+
use stdlib_io, only: open
8492
implicit none
8593
integer :: u
8694
u = open('example.dat', 'wt')
@@ -92,12 +100,16 @@ end program demo_open
92100

93101
## `savetxt` - save a 2D array into a text file
94102

103+
### Status
104+
105+
Experimental
106+
95107
### Description
96108
Saves a rank-2 `array` into a text file.
97109

98110
### Syntax
99111

100-
`call [[stdlib_experimental_io(module):savetxt(interface)]](filename, array)`
112+
`call [[stdlib_io(module):savetxt(interface)]](filename, array)`
101113

102114
### Arguments
103115

@@ -113,7 +125,7 @@ Provides a text file called `filename` that contains the rank-2 `array`.
113125

114126
```fortran
115127
program demo_savetxt
116-
use stdlib_experimental_io, only: savetxt
128+
use stdlib_io, only: savetxt
117129
implicit none
118130
real :: x(3,2) = 1
119131
call savetxt('example.dat', x)

doc/specs/stdlib_experimental_linalg.md renamed to doc/specs/stdlib_linalg.md

+24-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: experimental_linalg
2+
title: linalg
33
---
44

55
# Linear Algebra
@@ -8,13 +8,17 @@ title: experimental_linalg
88

99
## `diag` - Create a diagonal array or extract the diagonal elements of an array
1010

11+
### Status
12+
13+
Experimental
14+
1115
### Description
1216

1317
Create a diagonal array or extract the diagonal elements of an array
1418

1519
### Syntax
1620

17-
`d = [[stdlib_experimental_linalg(module):diag(interface)]](a [, k])`
21+
`d = [[stdlib_linalg(module):diag(interface)]](a [, k])`
1822

1923
### Arguments
2024

@@ -30,7 +34,7 @@ Returns a diagonal array or a vector with the extracted diagonal elements.
3034

3135
```fortran
3236
program demo_diag1
33-
use stdlib_experimental_linalg, only: diag
37+
use stdlib_linalg, only: diag
3438
implicit none
3539
real, allocatable :: A(:,:)
3640
integer :: i
@@ -40,7 +44,7 @@ end program demo_diag1
4044

4145
```fortran
4246
program demo_diag2
43-
use stdlib_experimental_linalg, only: diag
47+
use stdlib_linalg, only: diag
4448
implicit none
4549
real :: v(:)
4650
real, allocatable :: A(:,:)
@@ -52,7 +56,7 @@ end program demo_diag2
5256

5357
```fortran
5458
program demo_diag3
55-
use stdlib_experimental_linalg, only: diag
59+
use stdlib_linalg, only: diag
5660
implicit none
5761
integer, parameter :: n = 10
5862
real :: c(n), ul(n-1)
@@ -66,7 +70,7 @@ end program demo_diag3
6670

6771
```fortran
6872
program demo_diag4
69-
use stdlib_experimental_linalg, only: diag
73+
use stdlib_linalg, only: diag
7074
implicit none
7175
integer, parameter :: n = 12
7276
real :: A(n,n)
@@ -79,7 +83,7 @@ end program demo_diag4
7983

8084
```fortran
8185
program demo_diag5
82-
use stdlib_experimental_linalg, only: diag
86+
use stdlib_linalg, only: diag
8387
implicit none
8488
integer, parameter :: n = 3
8589
real :: A(n,n)
@@ -93,13 +97,17 @@ end program demo_diag5
9397

9498
## `eye` - Construct the identity matrix
9599

100+
### Status
101+
102+
Experimental
103+
96104
### Description
97105

98106
Construct the identity matrix
99107

100108
## Syntax
101109

102-
`I = [[stdlib_experimental_linalg(module):eye(function)]](n)`
110+
`I = [[stdlib_linalg(module):eye(function)]](n)`
103111

104112
### Arguments
105113

@@ -113,7 +121,7 @@ Returns the identity matrix, i.e. a square matrix with ones on the main diagonal
113121

114122
```fortran
115123
program demo_eye1
116-
use stdlib_experimental_linalg, only: eye
124+
use stdlib_linalg, only: eye
117125
implicit none
118126
real :: a(3,3)
119127
A = eye(3)
@@ -122,21 +130,25 @@ end program demo_eye1
122130

123131
```fortran
124132
program demo_eye2
125-
use stdlib_experimental_linalg, only: eye, diag
133+
use stdlib_linalg, only: eye, diag
126134
implicit none
127135
print *, all(eye(4) == diag([1,1,1,1])) ! prints .true.
128136
end program demo_eye2
129137
```
130138

131139
## `trace` - Trace of a matrix
132140

141+
### Status
142+
143+
Experimental
144+
133145
### Description
134146

135147
Trace of a matrix (rank-2 array)
136148

137149
### Syntax
138150

139-
`result = [stdlib_experimental_linalg(module):trace(interface)](A)`
151+
`result = [stdlib_linalg(module):trace(interface)](A)`
140152

141153
### Arguments
142154

@@ -149,7 +161,7 @@ Returns the trace of the matrix, i.e. the sum of diagonal elements.
149161
### Example
150162
```fortran
151163
program demo_trace
152-
use stdlib_experimental_linalg, only: trace
164+
use stdlib_linalg, only: trace
153165
implicit none
154166
real :: A(3,3)
155167
A = reshape([1,2,3,4,5,6,7,8,9],[3,3])

doc/specs/stdlib_experimental_optval.md renamed to doc/specs/stdlib_optval.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: experimental_optval
2+
title: optval
33
---
44

55
# Default values for optional arguments
@@ -8,6 +8,10 @@ title: experimental_optval
88

99
## `optval` - fallback value for optional arguments
1010

11+
### Status
12+
13+
Experimental
14+
1115
### Description
1216

1317
Returns `x` if it is present, otherwise `default`.
@@ -16,7 +20,7 @@ This function is intended to be called in a procedure with one or more `optional
1620

1721
### Syntax
1822

19-
`result = [[stdlib_experimental_optval(module):optval(interface)]](x, default)`
23+
`result = [[stdlib_optval(module):optval(interface)]](x, default)`
2024

2125
### Arguments
2226

@@ -32,7 +36,7 @@ If `x` is present, the result is `x`, otherwise the result is `default`.
3236

3337
```fortran
3438
program demo_optval
35-
use stdlib_experimental_optval, only: optval
39+
use stdlib_optval, only: optval
3640
implicit none
3741
print *, root(64.0)
3842
! 8.0

0 commit comments

Comments
 (0)