Skip to content

Commit 84d6464

Browse files
[Fix] Update copyright and docstrings (#761)
* update copyright header * update docstring of PhyCRNet
1 parent 65fe200 commit 84d6464

File tree

3 files changed

+64
-22
lines changed

3 files changed

+64
-22
lines changed

ppsci/arch/nowcastnet.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import collections
216
from typing import Tuple
317

ppsci/arch/phycrnet.py

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
from typing import Tuple
216

317
import numpy as np
@@ -63,42 +77,42 @@ class PhyCRNet(base.Arch):
6377
6478
Args:
6579
input_channels (int): The input channels.
66-
hidden_channels (Tuple[int]): The hidden channels.
67-
input_kernel_size (Tuple[int]): The input kernel size.
68-
input_stride (Tuple[int]): The input stride.
69-
input_padding (Tuple[int]): The input padding.
80+
hidden_channels (Tuple[int, ...]): The hidden channels.
81+
input_kernel_size (Tuple[int, ...]): The input kernel size(s).
82+
input_stride (Tuple[int, ...]): The input stride(s).
83+
input_padding (Tuple[int, ...]): The input padding(s).
7084
dt (float): The dt parameter.
71-
num_layers (Tuple[int]): The number of layers.
85+
num_layers (Tuple[int, ...]): The number of layers.
7286
upscale_factor (int): The upscale factor.
73-
step (int, optional): The step. Defaults to 1.
74-
effective_step (Tuple[int], optional): The effective step. Defaults to (1).
87+
step (int, optional): The step(s). Defaults to 1.
88+
effective_step (Tuple[int, ...], optional): The effective step. Defaults to (1, ).
7589
7690
Examples:
7791
>>> import ppsci
7892
>>> model = ppsci.arch.PhyCRNet(
79-
... input_channels=2,
80-
... hidden_channels=[8, 32, 128, 128],
81-
... input_kernel_size=[4, 4, 4, 3],
82-
... input_stride=[2, 2, 2, 1],
83-
... input_padding=[1, 1, 1, 1],
84-
... dt=0.002,
85-
... num_layers=[3, 1],
86-
... upscale_factor=8
87-
... )
93+
... input_channels=2,
94+
... hidden_channels=[8, 32, 128, 128],
95+
... input_kernel_size=[4, 4, 4, 3],
96+
... input_stride=[2, 2, 2, 1],
97+
... input_padding=[1, 1, 1, 1],
98+
... dt=0.002,
99+
... num_layers=[3, 1],
100+
... upscale_factor=8
101+
... )
88102
"""
89103

90104
def __init__(
91105
self,
92106
input_channels: int,
93-
hidden_channels: Tuple[int],
94-
input_kernel_size: Tuple[int],
95-
input_stride: Tuple[int],
96-
input_padding: Tuple[int],
107+
hidden_channels: Tuple[int, ...],
108+
input_kernel_size: Tuple[int, ...],
109+
input_stride: Tuple[int, ...],
110+
input_padding: Tuple[int, ...],
97111
dt: float,
98-
num_layers: Tuple[int],
112+
num_layers: Tuple[int, ...],
99113
upscale_factor: int,
100114
step: int = 1,
101-
effective_step: Tuple[int] = (1),
115+
effective_step: Tuple[int, ...] = (1,),
102116
):
103117
super(PhyCRNet, self).__init__()
104118

ppsci/arch/uscnn.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
from typing import Tuple
216
from typing import Union
317

0 commit comments

Comments
 (0)