Skip to content

Commit

Permalink
Merge branch 'cyclus:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschalz committed Jun 10, 2021
2 parents b2b1341 + 224e6e4 commit 5e20a18
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 58 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ cyclus Change Log

.. current developments
v1.5.5
====================
**Changed:**

* A reactor will now decommission itself if it is retired and the decomission requirement is met.

v1.5.4
====================

Expand Down
11 changes: 0 additions & 11 deletions news/decom_reactor.rst

This file was deleted.

13 changes: 0 additions & 13 deletions news/tab_space.rst

This file was deleted.

2 changes: 1 addition & 1 deletion src/cycamore_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define CYCAMORE_VERSION_MAJOR 1
#define CYCAMORE_VERSION_MINOR 5
#define CYCAMORE_VERSION_MICRO 0
#define CYCAMORE_VERSION_MICRO 5
#define CYCAMORE_VERSION "@cycamore_version@"

#endif // CYCAMORE_SRC_VERSION_H_
12 changes: 8 additions & 4 deletions src/enrichment.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class NatUConverter : public cyclus::Converter<cyclus::Material> {
/// The Enrichment facility is a simple Agent that enriches natural
/// uranium in a Cyclus simulation. It does not explicitly compute
/// the physical enrichment process, rather it calculates the SWU
/// required to convert an source uranium recipe (ie. natural uranium)
/// required to convert a source uranium recipe (ie. natural uranium)
/// into a requested enriched recipe (ie. 4% enriched uranium), given
/// the natural uranium inventory constraint and its SWU capacity
/// constraint.
Expand All @@ -109,7 +109,9 @@ class NatUConverter : public cyclus::Converter<cyclus::Material> {
/// If multiple output commodities with different enrichment levels are
/// requested and the facility does not have the SWU or quantity capacity
/// to meet all requests, the requests are fully, then partially filled
/// in unspecified but repeatable order.
/// in unspecified but repeatable order. A request for the product
/// commodity without an associated requested enriched recipe will not be
/// fulfilled.
///
/// The Enrichment facility also offers its tails as an output commodity with
/// no associated recipe. Bids for tails are constrained only by total
Expand All @@ -124,7 +126,7 @@ class Enrichment
"The Enrichment facility is a simple agent that enriches natural " \
"uranium in a Cyclus simulation. It does not explicitly compute " \
"the physical enrichment process, rather it calculates the SWU " \
"required to convert an source uranium recipe (i.e. natural uranium) " \
"required to convert a source uranium recipe (i.e. natural uranium) " \
"into a requested enriched recipe (i.e. 4% enriched uranium), given " \
"the natural uranium inventory constraint and its SWU capacity " \
"constraint." \
Expand All @@ -146,7 +148,9 @@ class Enrichment
"If multiple output commodities with different enrichment levels are " \
"requested and the facility does not have the SWU or quantity capacity " \
"to meet all requests, the requests are fully, then partially filled " \
"in unspecified but repeatable order." \
"in unspecified but repeatable order. A request for the product " \
"commodity without an associated requested enriched recipe will not be " \
"fulfilled." \
"\n\n" \
"Accumulated tails inventory is offered for trading as a specifiable " \
"output commodity.", \
Expand Down
22 changes: 11 additions & 11 deletions src/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Implements the Storage class
#include "storage.h"

namespace storage {
namespace cycamore {

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Storage::Storage(cyclus::Context* ctx)
Expand All @@ -16,29 +16,29 @@ Storage::Storage(cyclus::Context* ctx)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// pragmas

#pragma cyclus def schema storage::Storage
#pragma cyclus def schema cycamore::Storage

#pragma cyclus def annotations storage::Storage
#pragma cyclus def annotations cycamore::Storage

#pragma cyclus def initinv storage::Storage
#pragma cyclus def initinv cycamore::Storage

#pragma cyclus def snapshotinv storage::Storage
#pragma cyclus def snapshotinv cycamore::Storage

#pragma cyclus def infiletodb storage::Storage
#pragma cyclus def infiletodb cycamore::Storage

#pragma cyclus def snapshot storage::Storage
#pragma cyclus def snapshot cycamore::Storage

#pragma cyclus def clone storage::Storage
#pragma cyclus def clone cycamore::Storage

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Storage::InitFrom(Storage* m) {
#pragma cyclus impl initfromcopy storage::Storage
#pragma cyclus impl initfromcopy cycamore::Storage
cyclus::toolkit::CommodityProducer::Copy(m);
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Storage::InitFrom(cyclus::QueryableBackend* b) {
#pragma cyclus impl initfromdb storage::Storage
#pragma cyclus impl initfromdb cycamore::Storage

using cyclus::toolkit::Commodity;
Commodity commod = Commodity(out_commods.front());
Expand Down Expand Up @@ -255,4 +255,4 @@ extern "C" cyclus::Agent* ConstructStorage(cyclus::Context* ctx) {
return new Storage(ctx);
}

} // namespace storage
} // namespace cycamore
12 changes: 5 additions & 7 deletions src/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
#include <vector>

#include "cyclus.h"
#include "cycamore_version.h"

// forward declaration
namespace storage {
class Storage;
} // namespace storage


namespace storage {
namespace cycamore {
/// @class Storage
///
/// This Facility is intended to hold materials for a user specified
Expand Down Expand Up @@ -99,6 +95,8 @@ class Storage
/// The handleTick function specific to the Storage.
virtual void Tock();

virtual std::string version() { return CYCAMORE_VERSION; }

protected:
/// @brief adds a material into the incoming commodity inventory
/// @param mat the material to add to the incoming inventory.
Expand Down Expand Up @@ -237,6 +235,6 @@ class Storage
friend class StorageTest;
};

} // namespace storage
} // namespace cycamore

#endif // CYCLUS_STORAGES_STORAGE_H_
6 changes: 3 additions & 3 deletions src/storage_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "storage_tests.h"

namespace storage {
namespace cycamore {

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StorageTest::SetUp() {
Expand Down Expand Up @@ -503,11 +503,11 @@ TEST_F(StorageTest, Longitude){
EXPECT_EQ(qr.GetVal<double>("Longitude"), 35.0);
}

} // namespace storage
} // namespace cycamore

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cyclus::Agent* StorageConstructor(cyclus::Context* ctx) {
return new storage::Storage(ctx);
return new cycamore::Storage(ctx);
}

// required to get functionality in cyclus agent unit tests library
Expand Down
17 changes: 9 additions & 8 deletions src/storage_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "facility_tests.h"
#include "agent_tests.h"

namespace storage {
namespace cycamore {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class StorageTest : public ::testing::Test {
protected:
Expand All @@ -20,14 +20,15 @@ class StorageTest : public ::testing::Test {
virtual void TearDown();
void InitParameters();
void SetUpStorage();
void TestInitState(storage::Storage* fac);
void TestAddMat(storage::Storage* fac,
void TestInitState(cycamore::Storage* fac);
void TestAddMat(cycamore::Storage* fac,
cyclus::Material::Ptr mat);
void TestBuffers(storage::Storage* fac, double inv, double
void TestBuffers(cycamore::Storage* fac, double inv, double

proc, double ready, double stocks);
void TestStocks(storage::Storage* fac, cyclus::CompMap v);
void TestReadyTime(storage::Storage* fac, int t);
void TestCurrentCap(storage::Storage* fac, double inv);
void TestStocks(cycamore::Storage* fac, cyclus::CompMap v);
void TestReadyTime(cycamore::Storage* fac, int t);
void TestCurrentCap(cycamore::Storage* fac, double inv);

std::vector<std::string> in_c1, out_c1;
std::string in_r1;
Expand All @@ -36,6 +37,6 @@ class StorageTest : public ::testing::Test {
double throughput, max_inv_size;
bool discrete_handling;
};
} // namespace storage
} // namespace cycamore
#endif // STORAGE_TESTS_H_

0 comments on commit 5e20a18

Please sign in to comment.